ASP.NET2.0发送电子邮件
1
try
2
{
3![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
MailMessage m_message = new MailMessage();
5
m_message.From = new MailAddress("fuchifeng45@yahoo.com.cn");
6
m_message.To.Add(new MailAddress("fuchifeng45@yahoo.com.cn"));
7
m_message.Subject = "使用.NET 2.0发送邮件sample";
8
m_message.Body = "非常简单 ";
9
SmtpClient m_smtpClient = new SmtpClient();
10
m_smtpClient.Send(m_message);
11
Console.WriteLine("发送成功!");
12
}
13
catch (Exception e)
14
{
15
Console.WriteLine(e.Message);
16
}
17
Console.ReadLine();
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
web.config或App.config中配置
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
这里和大家分享和学习如何学IT!