EXEC msdb.dbo.sp_send_dbmail @profile_name ='Mail Profile Name', @body = 'test message', @body_format ='HTML', @recipients ='myid@gmail.com', @subject = 'TEST MAIL FROM DB' ;
MailMessage mail = new MailMessage(); SmtpClient smtpC = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress(fromMailId); mail.To.Add(toMailId); mail.Subject = "Subject"; mail.Body = "Message in html format"; mail.IsBodyHtml = true; smtpC.Port = 587; smtpC.Credentials = new System.Net.NetworkCredential(fromMailId, password); smtpC.EnableSsl = true; smtpC.Send(mail);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)