紧急求救(发邮件不成功)
M_mail.From = this.TextBox4.Text; //发信人
M_mail.To = this.TextBox1.Text; //收件人
M_mail.Subject = this.TextBox3.Text; //标题
M_mail.Body = this.TextBox5.Text; //正文
//优先级
M_mail.Priority = MailPriority.Normal;
if(this.DropDownList1.Text== "高 ")
{
M_mail.Priority = MailPriority.High;
}
else if (this.DropDownList1.Text == "低 ")
{ M_mail.Priority = MailPriority.Low; }
//正文格式
M_mail.BodyFormat = MailFormat.Text;
if (this.DropDownList2.Text == "HTML格式 ")
{ M_mail.BodyFormat = MailFormat.Html; }
M_mail.BodyEncoding = System.Text.Encoding.UTF8;
//添加抄收人
if (this.TextBox2.Text != " ")
{
M_mail.Cc = this.TextBox2.Text.ToString();
}
//发送邮件
try
{
//设置服务器验证
M_mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ", "1 ");
//验证用户名
M_mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername ", "lu ");
//验证密码
M_mail.Fields.Add( "http://schemas.microsoft.com/cdo/c