最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
最简单的发送附件的例子,给SMITHPENG
时间:2022-07-02 12:05:01 编辑:袖梨 来源:一聚教程网
try
{
MailMessage oMail = new MailMessage();
Console.WriteLine("Mail Created");
oMail.To = "yateent@hotmail.com";
oMail.Cc = "yateen_thakkar@syntelinc.com";
oMail.From = "yateent@hotmail.com";
oMail.Subject = "Hi Yateen";
oMail.BodyFormat = MailFormat.Html;
string strBody = "Hello Yateen" +
" This is from .NET";
oMail.Body = strBody;
oMail.Attachments.Add(new MailAttachment("c:aishwarya1.jpg"));
SmtpMail.Send(oMail);
Console.WriteLine("Mail Sent");
}
catch(Exception ex)
{
Console.WriteLine("Error : " + ex.Message);
}
{
MailMessage oMail = new MailMessage();
Console.WriteLine("Mail Created");
oMail.To = "yateent@hotmail.com";
oMail.Cc = "yateen_thakkar@syntelinc.com";
oMail.From = "yateent@hotmail.com";
oMail.Subject = "Hi Yateen";
oMail.BodyFormat = MailFormat.Html;
string strBody = "Hello Yateen" +
" This is from .NET";
oMail.Body = strBody;
oMail.Attachments.Add(new MailAttachment("c:aishwarya1.jpg"));
SmtpMail.Send(oMail);
Console.WriteLine("Mail Sent");
}
catch(Exception ex)
{
Console.WriteLine("Error : " + ex.Message);
}
相关文章
- 火影忍者怎么获得大招 05-03
- 星际战甲新手什么刀好 05-03
- 文明6秦始皇金字塔怎么加速 05-03
- 全民奇迹2龙骸巨剑怎么获得 05-03
- 星露谷物语鲟鱼怎么获得 05-03
- 长安幻想怎么转职 05-03