Hi
It is easy to send email from office 365 online .Below is the code .
SmtpClient server = new SmtpClient("Your email server name");
server.Port = 587;
server.EnableSsl = true;
server.Credentials = new System.Net.NetworkCredential("Your outlook login id", "Your outlook login password");
server.UseDefaultCredentials = false;
MailMessage mail = new MailMessage();
mail.From = new MailAddress("From mail address");
mail.To.Add("To address");
mail.Subject = "Your Subject";
mail.Body = body;
mail.IsBodyHtml = true;
server.Send(mail);
Enjoy........................
No comments:
Post a Comment