SMTP: different mail from and from addresses?

M

Max Metral

Does anyone know if it's possible to make CDO send different "MAIL FROM"
addresses and "From" header in a message?

Our site allows users to send mail to others via the system, but since the
mail originates at our servers, the MAIL FROM needs to have our address, but
the From should have the end users. This is known as envelope masquerading,
among a bunch of other names.

I tried various Fields, header setting, etc, but nothing worked. I assume
the built in class can't handle it, question is can another component?
 
S

Steven Cheng[MSFT]

Hi Max,

As for the problem you mentioned, I'm not sure what's the "MAIL FROM" you
mentioned. Generally the .net System.Web.Mail component's MailMessage only
contains a "From" property which represent the "From" header of a mail.
And in the CDO's IMessage Interface, there have two properties, "From" and
"Sender" which have different usages, below is the description on the
difference of "Sender" and "From" properties:

======================
The difference between the From and Sender properties is that the Sender
property represents the messaging user that actually submits the message,
while the From property designates its principal author or authors. If the
author and the sender are the same, it is only necessary to set the From
property, and it is recommended to leave the Sender property unset in this
case.
========================

Also, here is the original link in MSDN:

#From Property
http://msdn.microsoft.com/library/en-us/cdosys/html/_cdosys_imessage_from.as
p?frame=true

#Sender Property
http://msdn.microsoft.com/library/en-us/cdosys/html/_cdosys_imessage_sender.
asp?frame=true

In addition, as far as I know , the System.Web.Mail and CDO are the
existing buildin components that .net framework and COM provide. If the
existing properties of them are not enough, I'm afraid we may look for some
other 3rd party raw SMTP components.

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
M

Max Metral

Basically there are two "parts" in SMTP. There's the commands that the
client sends that say "here's the envelope information about this message:
the from address, recipients, etc" and then later in the SMTP transaction,
the client sends the "text" headers that show up in the mail client. This
is how Bcc works. An address is in the envelope command phase, but not in
the headers.

So what I was hoping to do was to get SmtpMail to send the envelope from
address as one thing, but the from address in the message headers as
something else. It doesn't look like it's possible with regular SmtpMail,
but it's a trivial change. So what I did was get SmtpMail from the Mono
project and modify it there. :)
 
S

Steven Cheng[MSFT]

Hi Max,

Thanks for your response. Yes, the buildin SMTPMAIL(based on the CDO
internally) or CDO component are all limited to the OS. Anyway, as you
mentioned that
=================
So what I did was get SmtpMail from the Mono
project and modify it there.
=================

Sounds great! Also, if you got any good ideas, please feel free to post
here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top