MailMessage.Send

  • Thread starter Thread starter Stuart Ferguson
  • Start date Start date
S

Stuart Ferguson

Just a quick question on the MailMessage class' Send function.

Does this function wait on the SMTP server actually sending the message
or does it just pass it onto the mail server and leavie it there ?

Stuart
 
Hi,

I think it depends of the configuration of the server. Send just return
when it complete the SMTP "conversation"

Cheers,
 
You are correct. Send will only return when it has gotten a SUCCESS or
FAILURE.
The message will not be put on a queue somewhere. Although you can make your
application to put them in a queue.

-Landi
 
How would i go about that as i need the message only to be queued not
wait until the message goes ?
 
Stuart,
The only thing that I would suggest doing is to put the Send part into a
thread and in that thread do retries or put it in an error log or file
somewhere where you can later go and retry them. Or you can implement your
own queue. If you use localhost (IIS SMTP server) as your SMTP server then I
think that that will insert errors into the error folder under mail. There
is also a queue folder in there but I don't know much about IIS and its SMTP
server and how that works. Maybe someone know a little more about this.

--Landi
 
Back
Top