gpt4 book ai didi

asp-classic - 使用经典 ASP,是否可以通过 CDO 地址设置 SMTP 信封?

转载 作者:行者123 更新时间:2023-12-02 21:53:29 25 4
gpt4 key购买 nike

我使用经典 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com