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

V S N Raju KanumuriRank #8,839 · 215 reputationPosted Apr 16, 2012, 4:36 AM EDT
using System.Net.Mail;
Use This Code
Veera Chenna26 reputationPosted Apr 16, 2012, 7:02 AM EDT
http://technico.qnownow.com/2012/03/21/how-to-send-an-email-with-attachment-in-c-using-smtp4dev-gmail-hotmail-yahoo-smtp-servers/
Sam HobbsRank #107 · 20.5K reputationPosted Apr 16, 2012, 11:56 AM EDT
Do you see "Our recommended articles" at the right side of this window?
This web site has some useful articles relevant to your question.
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 16, 2012, 7:46 PM EDT
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.