如何控制从ASP.NET应用程序发送电子邮件的顺序

时间:2021-12-29 06:05:55

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.

我有使用相同机制发送email1和email2的代码:System.Net.Mail.SmtpClient。

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

电子邮件总是在订单email2,email1中到达(即使我发送电子邮件2和电子邮件1)。

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

我已尝试按http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=166439&中的建议设置超时属性。

like this

Public Class SmtpClientAdapter Inherits SmtpClient

公共类SmtpClientAdapter继承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

我一直试图发现是否可以使用SMTP标头延迟传递

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

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

有谁知道我是否可以使用ASP.NET的这个头?

Derek

1 个解决方案

#1


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.

处理延迟传递标头不是ASP.NET的责任。它由您发送电子邮件的SMTP服务器选择支持该标头。

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

一般来说,您无法真实地期望控制电子邮件传递的顺序。

#1


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.

处理延迟传递标头不是ASP.NET的责任。它由您发送电子邮件的SMTP服务器选择支持该标头。

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

一般来说,您无法真实地期望控制电子邮件传递的顺序。