大家好,
我发送邮件后保存在数据库中的数据。在我的系统邮件发送工作正常。
但是当我主办邮件客户端系统不发送。
string ToMailIds = string.Empty;
string CCMailIds = string.Empty;
System.Net.Mail.MailMessage EMail = new System.Net.Mail.MailMessage();
EMail.To.Add(new System.Net.Mail.MailAddress(toaddress.Text));
EMail.Subject = txtsubject.Text ;
EMail.Body = "<font face="verdana" size="2">" + txtmsg.Text + "</font>";
EMail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
NetworkCredential net = new NetworkCredential();
EMail.From = new MailAddress(txtusername.Text);
net.UserName = txtusername.Text;
net.Password = txtpassword.Text;
smtp.Credentials = net;
if (net.UserName.Contains("gmail") == true)
{
smtp.EnableSsl = true;
}
smtp.Host = txtserver.Text;
smtp.Send(EMail);