Why is there a delay in sending email?

  • Thread starter Thread starter Curious
  • Start date Start date
C

Curious

Hi,

I use the following code to send email:

void SendEmailNotification(string body)
{
SmtpClient client = new SmtpClient
("pamweb.wherever.com");
MailAddress from = new MailAddress
("(e-mail address removed)");
MailAddress to = new MailAddress
("(e-mail address removed)");
MailMessage message = new MailMessage(from, to);
//message.Body = "Price Movers";

// Content of the email notification
message.Body = body;
message.BodyEncoding = System.Text.Encoding.UTF8;
message.Subject = "Price Movers";
message.SubjectEncoding = System.Text.Encoding.UTF8;
client.SendCompleted += new SendCompletedEventHandler
(SendCompletedCallback);

string userState = "test message1";
client.SendAsync(message, userState);
}

void SendCompletedCallback(object sender, EventArgs e )
{
MessageBox.Show(string.Format("Email notification sent
successfully"), "Email Status");

}

When I saw message box, "Email notification sent successfully", I
clicked on "OK" to dismiss it. Then it took almost 5 minutes before I
see the actual email in my Outlook Inbox. How can I speed up the email
delivery?

Thanks!
 
Curious said:
Hi,

I use the following code to send email:

void SendEmailNotification(string body)
{
SmtpClient client = new SmtpClient
("pamweb.wherever.com");
MailAddress from = new MailAddress
("(e-mail address removed)");
MailAddress to = new MailAddress
("(e-mail address removed)");
MailMessage message = new MailMessage(from, to);
//message.Body = "Price Movers";

// Content of the email notification
message.Body = body;
message.BodyEncoding = System.Text.Encoding.UTF8;
message.Subject = "Price Movers";
message.SubjectEncoding = System.Text.Encoding.UTF8;
client.SendCompleted += new SendCompletedEventHandler
(SendCompletedCallback);

string userState = "test message1";
client.SendAsync(message, userState);
}

void SendCompletedCallback(object sender, EventArgs e )
{
MessageBox.Show(string.Format("Email notification sent
successfully"), "Email Status");

}

When I saw message box, "Email notification sent successfully", I
clicked on "OK" to dismiss it. Then it took almost 5 minutes before I
see the actual email in my Outlook Inbox. How can I speed up the email
delivery?

Thanks!

That sounds to me like the default "Send/Recieve" time option from outlook
connecting to a server. Check what your options in outlook are set to under
"Tools", "Options", "Mail Setup", "Send/Recieve".

Mike
 
That sounds to me like the default "Send/Recieve" time option from outlook
connecting to a server.  Check what your options in outlook are set to under
"Tools", "Options", "Mail Setup", "Send/Recieve".

Mike- Hide quoted text -

- Show quoted text -

Mike,

Thanks for the advice! I'll check out this option in my Outlook.
 
Back
Top