c# - How to send email from yahoo id from my console application -


well m searching hard on google unable find working code let me send email using yahoo id on account using console application.

can body help?

you try following:

using (var client = new smtpclient("smtp.mail.yahoo.com", 587)) {     client.credentials = new networkcredential("youraccount@yahoo.com", "secret");     var mail = new mailmessage();     mail.from = new mailaddress("youraccount@yahoo.com");     mail.to.add("destaccount@gmail.com");     mail.subject = "test mail";     mail.body = "test body";     client.send(mail); } 

and if using .net versions prior 4.0, smtpclient doesn't implement idisposable might need remove using statement around it.


Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -