Developer C#

Useful scripts and C# features that are collected during application development

How to send email with attachment

using System.Net;
using System.Net.Mail;

public void email_send()
 MailMessage mail = new MailMessage();
 SmtpClient SmtpServer = new SmtpClient("");
 mail.From = new MailAddress("your");
 mail.Subject = "Test Mail - 1";
 mail.Body = "mail with attachment";

 System.Net.Mail.Attachment attachment;
 attachment = new System.Net.Mail.Attachment("c:/textfile.txt");

 SmtpServer.Port = 587;
 SmtpServer.Credentials = new System.Net.NetworkCredential("your", "your password");
 SmtpServer.EnableSsl = true;



Microsoft Exchange SAN UCC SSL