日期:2014-05-17  浏览次数:21118 次

使用Sysdate.Net.Mail發送Mail問題
我的問題如何讓發送出去的MAIL,在接收到MAIL的人不可以再轉寄該封MAIL.

下面是正常發送MAIL的Function:
  public void SendMailUseSMTP(string subject, string MailHost, string MailFrom, string MailFromPassWord, string MailTo, string MailCc, string text, string AttachmentsName, bool IsBodyHtml)
  {
  try
  {
  MailMessage msg = new MailMessage();
  string[] To = MailTo.Split(';');
  for (int i = 0; i < To.Length; i++)
  {
  msg.To.Add(To[i]);
  }

  string[] CC = MailCc.Split(';');
  for (int j = 0; j < CC.Length; j++)
  {
  msg.CC.Add(CC[j]);
  }
  msg.From = new MailAddress(MailFrom, MailFrom, System.Text.Encoding.UTF8);
  msg.Subject = subject;
  msg.SubjectEncoding = System.Text.Encoding.UTF8;
  msg.Body = text;
  msg.BodyEncoding = System.Text.Encoding.UTF8;
  msg.IsBodyHtml = IsBodyHtml;
  msg.Priority = MailPriority.High;
  if (AttachmentsName != "")
  {
  msg.Attachments.Add(new Attachment(AttachmentsName));
  }

  SmtpClient client = new SmtpClient();
  client.Credentials = new System.Net.NetworkCredential(MailFrom, MailFromPassWord);
  client.Host = MailHost;
  object userState = msg;

  client.SendAsync(msg, userState);
  }
  catch (System.Net.Mail.SmtpException ex)
  {
  throw new Exception("SendMailUseSMTP Subject:" + subject + " Exception:" + ex.Message);
  }
  }

------解决方案--------------------
接收mail的帐号