如何从雅虎邮箱编号发送邮件在VB.NET或C#.NET代码 [英] How to send mail from yahoo mail Id in VB.NET or C#.NET code
本文介绍了如何从雅虎邮箱编号发送邮件在VB.NET或C#.NET代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从我的yahoomail Id.How发送邮件到雅虎邮件标识在VB.NET或C#.NET代码发送邮件。那种需要帮助..先感谢。
I want to send mail from my yahoomail Id.How to send mail from yahoo mail Id in VB.NET or C#.NET code. Kind help needed.. Advance Thanks.
Sivakumar.P
Sivakumar.P
推荐答案
这里是做一个基本的HTML电子邮件中的一些例子。
Here are some examples of doing a basic html email messages.
的 http://help.yahoo.com/l/us/yahoo/mail/original/mailplus/pop/pop-14.html 一>
' VB
Dim m As MailMessage = New MailMessage
m.From = New MailAddress("you@yahoo.com", "Your Name")
m.To.Add(New MailAddress("Recipient@somedomain.com", "Recipient Name"))
m.Subject = "Hello"
' Specify an HTML message body
m.Body = "<html><body><h1>My Message</h1><br>Put the body here.</body></html>"
m.IsBodyHtml = True
' Send the message
Dim client As SmtpClient = New SmtpClient("smtp.mail.yahoo.com")
client.Send(m)
// C#
MailMessage m = new MailMessage();
m.From = new MailAddress("you@yahoo.com", "Your Name");
m.To.Add(new MailAddress("Recipient@somedomain.com", "Recipient Name"));
m.Subject = "Hello";
// Specify an HTML message body
m.Body = "<html><body><h1>My Message</h1><br>Put the body here.</body></html>";
m.IsBodyHtml = true;
// Send the message
SmtpClient client = new SmtpClient("smtp.mail.yahoo.com");
client.Send(m);
这篇关于如何从雅虎邮箱编号发送邮件在VB.NET或C#.NET代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文