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

标签 asp-classic smtp messaging

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

相关文章:

Java - SimpleMimeMessage 未设置主题

google-cloud-platform - GCP 上的电子邮件解决方案

msmq - 如何在 NServiceBus 中按命名空间配置 MessageEndpointMapping

apache-kafka - 为什么我不能使用 Kafka Administration REST API for Bluemix Message Hub 以编程方式添加和删除主题?

asp.net-mvc - 经典 ASP 和 MVC 并行,不同的项目?

asp-classic - 如何在Classic ASP中使变量成为静态变量(或 “global”)?

javascript - 谷歌地图和 ASP

windows - 将传入电子邮件通过管道传输到 Windows IIS SMTP 上的脚本?

java - ASP 中的 EOF 和 BOF

android - 设备重新联机后,Google 云消息传递 (GCM) 无法传送