使用经典 ASP,是否可以使用 CDO 地址设置 SMTP 信封?

发布于 2024-10-18 05:41:51 字数 1334 浏览 5 评论 0 原文

我正在使用带有 CDOSYS 对象的经典 ASP 发送邮件,但我希望将信封发件人地址(即 SMTP 期间由 MAIL FROM 指定的信封地址)设置为与邮件中的 From 标头地址不同。

这样做的目的是实现VERP。例如,我希望 SMTP 对话类似于:

220 mail.example.com ESMTP
[...]
MAIL FROM: <[email protected]>
250 2.0.0 OK
RCPT TO: <[email protected]>
250 2.0.0 OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
From: Company1 <[email protected]>
To: [email protected]
[...]

在上面的示例中,来自的信封是“[电子邮件受保护]”,但发件人标头为“[电子邮件;受保护]”。

希望这是有道理的。有什么想法吗?

I am sending mail using classic ASP with the CDOSYS objects, but I would like the envelope from address - that is, the one that is specified by MAIL FROM during SMTP - to be set differently to the From header address in the message.

The purpose of this is to implement VERP. For example, I would expect the SMTP dialogue to be something like:

220 mail.example.com ESMTP
[...]
MAIL FROM: <[email protected]>
250 2.0.0 OK
RCPT TO: <[email protected]>
250 2.0.0 OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
From: Company1 <[email protected]>
To: [email protected]
[...]

In the above example, the envelope from is "[email protected]" but the From header is "[email protected]".

Hope this makes sense. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌逼全场 2024-10-25 05:41:51

好吧,我弄清楚了,我对它进行了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 = "[email protected]"
.Sender = "[email protected]"
.From="Company1 <[email protected]>"
.Subject = "This is a test CDOSYS message (Sent via Port 25)..."
.HTMLBody = strHTML
.Send
End With

ok I got it figured out and I wiresharked it and I see the commands as you want them...

Sorry about the horrible answer I gave you before. This will do it... it is the "SENDER" that you want for the MAIL FROM: envelope

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 = "[email protected]"
.Sender = "[email protected]"
.From="Company1 <[email protected]>"
.Subject = "This is a test CDOSYS message (Sent via Port 25)..."
.HTMLBody = strHTML
.Send
End With
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文