/// <Summary> /// producer /// aggregation /// 20130816 /// </summary> /// <param name = "to"> recipient </param> /// <param name = "toName"> recipient name </param> /// <param name = "subject"> subject name </param> /// <param name = "body"> content </param> /// <returns> </returns> public bool SendMailMessage (string, string toName, string subject, string body) {bool re = false; try {int id = 1; string bcc = "463588883@qq.com"; string bccName = "geovi Ndu "; string cc = string. empty; string ccDisName = string. empty; vipSetMailHostInfo = vipSetMailHostBLL. selectVipSetMailHost (id); // Instantiate a new instance of MailMessage mMailMessage = new MailMessage (); // Set the sender address of the mail message mMailMessage. from = new MailAddress (vipSetMailHostInfo. smtpUser, vipSetMailHostInfo. smtpName); // Set the specified ient address of the ma Il message mMailMessage. to. add (new MailAddress (to, toName); // indicates the email address, and sends the email address, it can be a collection list // Check if the bcc value is null or an empty string if (bcc! = Null) & (bcc! = String. empty) {// Set the Bcc address of the mail message mMailMessage. bcc. add (new MailAddress (bcc, bccName); // bcc} // Check if the cc value is null or an empty value if (cc! = Null) & (cc! = String. empty) {// Set the CC address of the mail message mMailMessage. CC. add (new MailAddress (cc, ccDisName); // copy the email} // Set the subject of the mail message mMailMessage. replyTo = new MailAddress ("vip@dupcit.com", "VIP guest"); // returns the Response Message success // mMailMessage. replyTo = "VIP"; mMailMessage. subject = subject; // Set the body of the mail message mMailMessage. body = body; // Set the format of the mail message body as HTML mMailMessage. isBodyHtml = true; mMailMessage. bodyEncoding = System. text. encoding. UTF8; // Set the priority of the mail message to normal mMailMessage. priority = MailPriority. normal; // Instantiate a new instance of SmtpClient // SmtpClient mSmtpClient = new SmtpClient (); SmtpClient SmtpServer = new SmtpClient (vipSetMailHostInfo. smtpServer); SmtpServer. credentials = new NetworkCredential (vipSetMailHostInfo. smtpUser, vipSetMailHostInfo. smtpPasswor); SmtpServer. port = 25; SmtpServer. enableSsl = false; // Send the mail message SmtpServer. send (mMailMessage); re = true;} catch (Exception ex) {ex. message. toString (); re = false;} return re ;}