Hello Everyone,
I want to send email using c# in windows application.
i used snippet as following
System.Net.Mail.MailMessage mes = new System.Net.Mail.MailMessage();
mes.To.Add("[email protected]");
mes.Subject = "none";
mes.From = new System.Net.Mail.MailAddress("[email protected]");
mes.Body = "test";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.Port = 578;
smtp.Send(mes);
but it throws an smtp error
Please help me out.
If u have other snippet then please post it.
Regards,
Zuber Isak Kazi
Loading
Jignesh TrivediPosted Apr 16, 2012, 11:46 PM
please check your SMPT server is configure?
pass default credentials before send mail.
client.UseDefaultCredentials = true;
please refer
http://www.c-sharpcorner.com/uploadfile/scottlysle/send-email-messages-and-attachments-using-C-Sharp/
hope this help.
Sam HobbsPosted Apr 16, 2012, 3:56 PM
Do you see "Our recommended articles" at the right side of this window?
This web site has some useful articles relevant to your question.
Veera ChennaPosted Apr 16, 2012, 11:02 AM
http://technico.qnownow.com/2012/03/21/how-to-send-an-email-with-attachment-in-c-using-smtp4dev-gmail-hotmail-yahoo-smtp-servers/
V S N Raju KanumuriPosted Apr 16, 2012, 8:36 AM
using System.Net.Mail;
Use This Code