c# - How else can I email a file using ASP.NET? -


I am using the code given below in an asp.net page so that our user A mailbox that can be sent to a file is used to obtain the work that requires photocopies. The codes below work fine during sending a file to our network, but when our users stay at home and join our SSL VPN, a bug appears in our VPN, where this file is temporarily Before sending through email, the webserver can give any other suggestions about how to attach a file to an ASP.NET page and send it to the web server. Can send the file sent via email without scanning? Many thanks Jane

MailMessage Mail = New MailMessage (); Mail.From = txtFrom.Text; similarity. To = txtTo.Text; Mail.Cc = txtFrom.Text; Mail.Subject = txtSubject.Text; similarity. Body = "test" mail Bodyformat = mailformat Html; String strdir = "E: \\ TEMPforRefrographics \\"; // & lt; ------- Problems area strfilename = path. GetFileName (txtFile.PostedFile.FileName); Try {txtFile.PostedFile.SaveAs (strdir + strfilename); String strAttachment = strdir + strfilename; Mail.Attachments.Add (new mail attachment (strdir + strfilename)); SmtpMail.SmtpServer = "172.16.0.88"; SmtpMail.Send (Mail); reaction. Redirect ("Thanks. Espacks", is true); } Hold {Response.Write ("An error has been sent to email or file uplocading."); } Finally {}

If you use sections in System.Net The mail supports namespace, streams in the attachment category, so assume that you can read it in the form of a stream in memory, then you can add that attachment The way you have never been


Comments