0 votes

It seem s that not all of my emails in a list get sent.

Can this depend on the smtp-receivetimeout property?

If so: How do you use (in code) this property?
What does this property do?

Regards /AJ

by

1 Answer

0 votes

This property has nothing to do with your emails being delivered or not.

As the documentation/intelisense states:

ClientBase.ReceiveTimeout gets or sets the amount of time the underlying Socket will wait to receive data once a read operation is initiated.

Are you checking the return value of Smtp.SendMessage method?

using (Smtp smtp = new Smtp()) 
{
    smtp.Connect("server.example.com");    // or ConnectSSL for SSL
    smtp.UseBestLogin("user", "password"); // remove if authentication is not needed

    ISendMessageResult result = smtp.SendMessage(email);
    if (result.Status == SendMessageStatus.Success)
    {
        // Message was sent.
    }
    else 
    {
        string asString = result.ToString();

        // You can use other ISendMessageResult properties here:
        List<string> rejected = result.RejectedRecipients();
    }

    smtp.Close(); 
}
by (297k points)
Example of ReceiveTimeout
...