No. | Title |
---|---|
1 | Using office to send Email |
using System.Net; // Library to Include
using System.Net.Mail; // Library to Include
// Create a MailMessage object
MailMessage mail = new MailMessage();
mail.From = new MailAddress("YourEmail@company.com");
mail.To.Add("RecipientEmail@company.com");
mail.Subject = "Email Subject";
mail.Body = "Body of the email";
// Create a SmtpClient object with the SMTP settings of your email provider
SmtpClient smtpClient = new SmtpClient("smtp.office365.com", 587);
smtpClient.Credentials = new NetworkCredential("YourEmail@company.com", "YourEmailPassword");
smtpClient.EnableSsl = true;
// Send the email
smtpClient.Send(mail);