我使用经典 ASP 和 CDOSYS 对象发送邮件,但我希望信封发件人地址(即 SMTP 期间由 MAIL FROM 指定的信封地址)设置为与邮件中的 From header 地址不同.
这样做的目的是实现VERP 。例如,我希望 SMTP 对话类似于:
220 mail.example.com ESMTP
[...]
MAIL FROM: <info+test=example.com@mydomain.test>
250 2.0.0 OK
RCPT TO: <test@example.com>
250 2.0.0 OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
From: Company1 <info@mydomain.test>
To: test@example.com
[...]
在上面的示例中,信封的发件人为“info+test=example.com@mydomain.test”,但发件人 header 为“info@mydomain.test”。
希望这是有道理的。有什么想法吗?
最佳答案
好吧,我弄清楚了,我对它进行了wireshark,我看到了你想要的命令......
对于我之前给你的糟糕答案感到抱歉。这样就可以了...这是您想要的 MAIL FROM: 信封的“SENDER”
Const cdoSendUsingPort = 2
StrSmartHost = "localhost"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
With iConf.Fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Update
End With
With iMsg
Set .Configuration = iConf
.To = "test@example.com"
.Sender = "info+test=example.com@mydomain.test"
.From="Company1 <info@mydomain.test>"
.Subject = "This is a test CDOSYS message (Sent via Port 25)..."
.HTMLBody = strHTML
.Send
End With
关于asp-classic - 使用经典 ASP,是否可以通过 CDO 地址设置 SMTP 信封?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5061373/