Why is there a delay in sending email?

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!
 
F

Family Tree Mike

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
 
C

Curious

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top