Send emails directly through smtp, and send emails directly through smtp
/// <Param name = "fromEmail"> sender's email address </param>
/// <Param name = "toEmail"> multiple recipients are separated by commas (,). </param>
/// <Param name = "ccEmail"> multiple CC messages are separated by commas (,). </param>
/// <Param name = "bccEmail"> separate multiple BCC messages with commas (,). </param>
/// <Param name = "subject"> subject </param>
/// <Param name = "body"> email body </param>
/// <Param name = "smtpAddress"> email sending server </param>
/// <Param name = "account"> email sending account </param>
/// <Param name = "pwd"> email sending password </param>
/// <Returns> </returns>
Public static bool SendMailBySMTP (string body)
{
System. Net. Mail. MailMessage mail = new System. Net. Mail. MailMessage ("your mailbox @ yingu.com", "Your mailbox @ yingu.com ");
// Mail. s
Mail. SubjectEncoding = Encoding. UTF8;
Mail. Subject = "An error occurred while retrieving the matching data of Creditor's Rights Data ";
Mail. IsBodyHtml = true; // whether the content is allowed in HTML Format
Mail. BodyEncoding = Encoding. UTF8;
Mail. Body = body;
SmtpClient smtp = new SmtpClient ("smtp.qiye.163.com ");
Smtp. Credentials = new NetworkCredential ("your mailbox @ yingu.com", "email password"); // SMTP Verification
// Smtp. DeliveryMethod = SmtpDeliveryMethod. PickupDirectoryFromIis;
Bool rr = true;
Try
{
Smtp. Send (mail );
}
Catch (Exception ex)
{
Rr = false;
}
Mail. Attachments. Dispose (); // After the email is sent, the attachment is locked.
Return rr;
}