ASP.NET MVC, MVC, C#, PYTHON, JQUERY

Saturday, August 25, 2018

How to send SMTP Email ?

                How to Send Email Using SMTP mail





                        MailMessage mail = new MailMessage();
                        mail.To.Add(item);
                        mail.Subject = subject;
                        mail.Body = message;
                        mail.IsBodyHtml = true;
                        SmtpClient smtp = new SmtpClient();
                        smtp.Host = "smtp.gmail.com";
                        smtp.Port = 587;
                        smtp.UseDefaultCredentials = false;
                        smtp.Credentials = new System.Net.NetworkCredential(email, pass);                                                    smtp.EnableSsl = true;
                        smtp.Send(mail);
Share:

0 comments:

Post a Comment

SOCIAL PROFILES

Search This Blog

Powered by Blogger.

Fixed Menu (yes/no)

yes

Contact Form

Name

Email *

Message *

Tags

Ads Section

Tags

ASP.NET MVC (7) C# (11) jQuery (1)