使用经典ASP,能否通过CDO设置SMTP信封发件人地址?

3
我正在使用经典ASP和CDOSYS对象发送邮件,但我希望信封的发件地址(即在SMTP期间由MAIL FROM指定的地址)与消息中的发件人地址(From头)不同。
这样做的目的是实现 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",但发件人头部是"info@mydomain.test"。
希望这样说起来有意义。有什么想法吗?
1个回答

0

好的,我已经弄清楚了,并且使用Wireshark进行了分析,我看到了您想要的命令...

非常抱歉之前给您的答案很糟糕。这个可以解决问题...您需要使用"SENDER"作为MAIL FROM:信封的发送者。

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

我完全误解了你的问题,是的,我的回答是一堆不相符的想法...就像我在打字时大脑里的线路交叉了一样。对此我感到抱歉...我现在明白你想做什么了...这是一个有趣的问题。 - John Sobolewski

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接