In an asp.net page I am sending emails with attachments to have the problem files stored on another server. Please try to give the URL to the file, but error "URI formats are not supported." Please direct me how to attach files to other servers. First, load the file inside the c # / asp.net code by using Do not forget to delete the local file when the email is already sent. Edit : It should work directly with the file path if the file is under the same website, then try using it: The same is true if this file is where you downloaded the file from another domain. If the file is not under the website, then you should be good by using paths like I hope it helps!
Message. Add (new attachment ("http: // domain .com / upload / cv.doc"));
HttpWebRequest Read the results by using the
StreamReader , save it to a local file (which is the right on the file system that is in your ASP.Net app). Then specify the filename of the newly created file.
var filePath = HttpContext.Current.Server.MapPath ("/ someTempFile.dat"); // here / - The website is root. // Now use FilePath as an argument for attachment () constructor
var filePath = "C: \ SomeTempFolder \ someTempFile.dat";
Comments
Post a Comment