发邮件???????
private void Button1_Click(object sender, System.EventArgs e)
{
if(Page.IsValid==true)
{
string to2,from2,cc2,bcc2,topic2,content2;
to2=to.Text;
from2=from.Text;
cc2=cc.Text;
bcc2=bcc.Text;
topic2=topic.Text;
content2=content.Text;
MailMessage mm=new MailMessage();
mm.From=from2.ToString();
mm.To=to2.ToString();
mm.Cc=cc2.ToString();
mm.Bcc=bcc2.ToString();
mm.Subject="topic2";
mm.Priority=MailPriority.High;
mm.BodyEncoding=System.Text.Encoding.GetEncoding("Gb2312");
mm.BodyFormat=(MailFormat)bodyformail.SelectedIndex;
mm.BodyFormat=MailFormat.Html;
mm.Body="content2";
try
{
SmtpMail.SmtpServer="smtp.sina.com.cn";//设置SMTP服务
SmtpMail.Send(mm);
Label1.Text="发送成功!";
}
catch(Exception ex)
{
Label1.Text=ex.ToString();
}
}
}