G
Guest
Hi all, I am using an asp.net page to send e-mail to an internal exchange
server. The code completes, but the mail doesn't get sent from webserver for
at least a minute or more. Is there any reason why the e-mail is delayed?
My code to mail is below:
public void SendEmailToTechnician(string sTo, string sSubject, string
sBody)
{
oMailMessage.From = new
MailAddress(ConfigurationManager.AppSettings["SMTPFromAddress"].ToString());
oMailMessage.To.Add(new MailAddress(sTo));
oMailMessage.Subject = sSubject;
oMailMessage.Body = sBody + "<END MESSAGE>";
oMailMessage.IsBodyHtml = false;
oMailMessage.Priority = MailPriority.High;
SmtpClient oClient = new
SmtpClient(ConfigurationManager.AppSettings["SMTPServer"].ToString());
oClient.DeliveryMethod = SmtpDeliveryMethod.Network;
try
{
oClient.Send(oMailMessage);
}
catch (Exception ex)
{
oGlobal.Redirect("Error.aspx?Error=" + ex.Message.ToString() +
"&STACK=" + ex.StackTrace.ToString());
}
}
server. The code completes, but the mail doesn't get sent from webserver for
at least a minute or more. Is there any reason why the e-mail is delayed?
My code to mail is below:
public void SendEmailToTechnician(string sTo, string sSubject, string
sBody)
{
oMailMessage.From = new
MailAddress(ConfigurationManager.AppSettings["SMTPFromAddress"].ToString());
oMailMessage.To.Add(new MailAddress(sTo));
oMailMessage.Subject = sSubject;
oMailMessage.Body = sBody + "<END MESSAGE>";
oMailMessage.IsBodyHtml = false;
oMailMessage.Priority = MailPriority.High;
SmtpClient oClient = new
SmtpClient(ConfigurationManager.AppSettings["SMTPServer"].ToString());
oClient.DeliveryMethod = SmtpDeliveryMethod.Network;
try
{
oClient.Send(oMailMessage);
}
catch (Exception ex)
{
oGlobal.Redirect("Error.aspx?Error=" + ex.Message.ToString() +
"&STACK=" + ex.StackTrace.ToString());
}
}