TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marvin kakuru
1.4k
355
160.1k
Sending email from Windows form application
Aug 2 2016 7:56 AM
Hi everyone, I hv been using the code below to send emails with much success but now it doesn't work any more. Any help will be much appreciated. Code public void SendEmail() { try { SmtpClient clientSMTP = new SmtpClient("smtp.gmail.com", 587); clientSMTP.EnableSsl = true; clientSMTP.DeliveryMethod = SmtpDeliveryMethod.Network; clientSMTP.UseDefaultCredentials = false; clientSMTP.Credentials = new NetworkCredential("
[email protected]
", "password"); using(MailMessage message = new MailMessage()) { message.From = new MailAddress("yourgmailid @gmail.com"); message.Subject = "Subject"; message.IsBodyHtml = true; message.To.Add("
[email protected]
"); message.Body = "Hi " + "Suresh" + "!\n" + "Welcome to C# Corner!" + "Please click here to activate your account. \nThanks!"; clientSMTP.Send(message); } } catch (Exception ex) {} finally {}
Reply
Answers (
9
)
XML to SQL Server data extraction
chart resizing manually