# Region email
Public static bool webmail (string host, int port, string uid, string PWD, bool SSL, string from, string to, string subject, string body)
{
// String STR = "successful ";
System. net. Mail. smtpclient mail = new system. net. Mail. smtpclient ();
Mail. Host = host;
Mail. Port = port;
Mail. Credentials = new system. net. networkcredential (UID, PWD );
Mail. enablessl = SSL;
System. net. Mail. mailmessage message = new system. net. Mail. mailmessage (from, );
Message. Body = body;
Message. Subject = subject;
Message. subjectencoding = system. Text. encoding. getencoding ("gb2312 ");
Message. bodyencoding = system. Text. encoding. getencoding ("gb2312 ");
Message. isbodyhtml = true;
Try
{
Mail. Send (Message );
Message. Dispose ();
Return true;
// Return STR;
}
Catch (exception ex)
{
Message. Dispose ();
Return false;
// Return ex. tostring ();
}
}
# Endregion