public bool send_mail()
{
try
{
MailMessage msg = new MailMessage("user123@dokra.com", "pabitra.best28@gmail.com");
msg.Subject = "My Subject";
msg.Body = "hello";
msg.IsBodyHtml = true;
AlternateView view;
SmtpClient client;
msg.IsBodyHtml = true;
client = new SmtpClient();
client.Host = "smtp.zoho.com";
client.Port = 587;
client.Credentials = new System.Net.NetworkCredential("user123@dokra.com", "password");
client.EnableSsl = true; //Gmail works on Server Secured Layer
client.Send(msg);
return true;
}
catch (Exception ex)
{ throw ex; }
}
{
try
{
MailMessage msg = new MailMessage("user123@dokra.com", "pabitra.best28@gmail.com");
msg.Subject = "My Subject";
msg.Body = "hello";
msg.IsBodyHtml = true;
AlternateView view;
SmtpClient client;
msg.IsBodyHtml = true;
client = new SmtpClient();
client.Host = "smtp.zoho.com";
client.Port = 587;
client.Credentials = new System.Net.NetworkCredential("user123@dokra.com", "password");
client.EnableSsl = true; //Gmail works on Server Secured Layer
client.Send(msg);
return true;
}
catch (Exception ex)
{ throw ex; }
}
No comments:
Post a Comment