Using classic ASP, is it possible to configure an SMTP envelope from an address using CDO?

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

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

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
[...]

In the above example, the envelope is from " info+test=example.com@mydomain.test ", but the From header is " info@mydomain.test ".

Hope this makes sense. Any ideas?

+3
source share
1 answer

ok , , , ...

, . ... "SENDER", 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 = "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
0

Source: https://habr.com/ru/post/1793490/


All Articles