////// 发送邮件方法 //////邮件地址///主题///内容///发送成功/// 创建日期:2008-7-20 /// 创建人:龚德辉 public static Boolean new_mail(string m_add, string m_sub, string m_body)//创建Mail,填入发送人,主题,內容 { try { MailMessage msz = new MailMessage();//建立邮件对象 msz.To = m_add; //string email是对方邮箱地址 //msz.From = "workflow@solartech.com.cn"; msz.From = "workflowweb@shinhint.gd.cn"; //可以是任意可用smtp地址 msz.Subject = m_sub; //邮件标题 msz.Body = m_body; msz.BodyFormat = MailFormat.Html; msz.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");//是否需要验证,一般是要的 msz.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "workflowweb");//自己邮箱的用户名 msz.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "1234");//自己邮箱的密码 SmtpMail.SmtpServer = "mailshinhint.shinhint";// 服务器地址 SmtpMail.Send(msz); //发送 return true; } catch { return false; } } #endregion