protected void Button1_Click(object sender, EventArgs e)
...{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
//收件人
message.To.Add(txtMailAddress.Text);
//抄送
foreach(string mailAddress in txtCopyAddress.Text.Split(','))
...{
if (!string.IsNullOrEmpty(mailAddress))
...{
message.CC.Add(mailAddress);
}
}
//主題
message.Subject = txtSubject.Text;
message.From = new System.Net.Mail.MailAddress(fromAddress);
message.Body = txtMailContents.Text;
//發送附件
if (fulAttachment.HasFile)