本文介绍了电子邮件发送Yahoo邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请我需要使用localhost的yahoo smtp服务器发送电子邮件的代码!!! 我有使用本地主机代码的gmail smtp服务器,它可以正常工作,但对于yahoo ...同样不起作用... :( 需要帮助:) 问候 哈莎 谢谢:)
Please i need a code for email sending using yahoo smtp server using localhost !!! i have gmail smtp server using local host code which is working working perfectly but the same is not not working for yahoo... :( Help needed :) Regards Harsha Thanks :)
推荐答案您可以尝试一下. You can try this. static void Main(string[] args) { SmtpMail oMail = new SmtpMail("TryIt"); SmtpClient oSmtp = new SmtpClient(); // Your yahoo email address oMail.From = "myid@yahoo"; // Set recipient email address oMail.To = "support@emailarchitect"; // Set email subject oMail.Subject = "test email from yahoo account"; // Set email body oMail.TextBody = "this is a test email sent from c# project with yahoo."; // Yahoo SMTP server address SmtpServer oServer = new SmtpServer("smtp.mail.yahoo"); // For example: your email is "myid@yahoo", then the user should be "myid@yahoo" oServer.User = "myid@yahoo"; oServer.Password = "yourpassword"; // Because yahoo deploys SMTP server on 465 port with direct SSL connection. // So we should change the port to 465. oServer.Port = 465; // detect SSL type automatically oServer.ConnectType = SmtpConnectType.ConnectSSLAuto; try { Console.WriteLine("start to send email over SSL ..."); oSmtp.SendMail(oServer, oMail); Console.WriteLine("email was sent successfully!"); } catch (Exception ep) { Console.WriteLine("failed to send email with the following error:"); Console.WriteLine(ep.Message); } }
如果这不能以某种方式帮助您,则可以检查这里
If this don''t help you somehow you can check here
更多推荐
电子邮件发送Yahoo邮件
发布评论