Public static void Sendmail (string toemail, string bodyemail, string subjectemail)
{
Try
{
Mailmessage Mm = new mailmessage ();
Mm. From = new mailaddress ("MESSYSTEM@AMATECH.CN", "MES system ");
// Mailaddress mafrom = new mailaddress ("MESSYSTEM@AMATECH.CN", "MES system ");
// Mm. From = mafrom;
Mm. to. Add (toemail );
Mm. Body = bodyemail;
Mm. Subject = subjectemail;
Mm. Priority = mailpriority. High;
Smtpclient SC = new smtpclient ();
SC. Host = "172.22.236.5 ";
String userid = "";
String pswd = "";
String domain = "";
Userid = "Pega \ roy_gu ";
Pswd = "@ xiaoli123"
Domain = "mail.sz.honyun.cn"
SC. Credentials = new system. net. networkcredential (userid, pswd, domain );
SC. deliverymethod = smtpdeliverymethod. Network;
SC. Send (mm );
}
Catch
{
MessageBox. Show ("sending failed. \ r \ n please contact the administrator! "," MES system ", messageboxbuttons. OK, messageboxicon. Exclamation );
}
}