C# 发送电子邮件源码片段
下面代码内容是关于c# 发送电子邮件片段的代码,应该对各位有所用途。
using system;
using system.web;
using system.web.mail;
public class testsendmail
{
public static void main()
{
try
{
mailmessage message = new mailmessage();
message.from = from@domain.com;
message.to = pengyun@cobainsoft.com;
message.cc = ;
message.bcc = ;
message.subject = subject;
message.body = content of message;
message.attachments.add(new mailattachment(c:\attach.txt, mailencoding.base64));
smtpmail.send(message);
system.console.writeline(message has been sent);
}
catch(exception ex)
{
system.console.writeline(ex.message.tostring());
}
}
}
上一篇: 方滨兴:大数据不能包治百病
下一篇: memcached-1.4.2发布