tags:

views:

65

answers:

1

Hi

I am trying to control the order that emails are sent from a web site.

I have code that sends email1 and email2 using the same mechanism : System.Net.Mail.SmtpClient.

The emails always arrive in the order email2, email1 (even if I send them email2 and email1).

I have tried setting the timeout properties as suggested here http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=166439&.

like this

Public Class SmtpClientAdapter Inherits SmtpClient

Public Sub SendEmail(ByVal message As System.Net.Mail.MailMessage)

    Host = Parameter.Data.GetString("SMTPServer")
    message.IsBodyHtml = True

    MyBase.ServicePoint.MaxIdleTime = 1
    MyBase.ServicePoint.ConnectionLimit = 1
    MyBase.Send(message)

End Sub

End Class

I have been trying to discover is I can make use of the SMTP header deferred-delivery

http://tools.ietf.org/html/rfc4021#section-2.1.65

Does anyone know if I can use this header from ASP.NET?

Derek

+5  A: 

It is not ASP.NETs responsibility to handle the deferred-delivery header. Its up to the SMTP server to which you send the email to choose support that header.

Generally speaking you cannot realistically expect to control the sequence of email delivery.

AnthonyWJones
"you can't" +1
annakata