login about faq

I’m trying to get the email to show sent on the behalf of X, but it’s not working. I’ve added the following below. Using VB.net, and what am I missing?

email.ReplyTo = String.Format("{0} <{1}>", personsname, owneremail.Trim)

email.Sender = String.Format("{0} <{1}>", personsname, owneremail.Trim)

asked Nov 26 '15 at 14:05

chilkat's gravatar image

chilkat ♦♦
11.8k316358421


The email.ReplyTo property is simply going to set the Reply-To header. By default it is empty and no Reply-To header exists. (Receipients would normally reply to the From email address.)

The email.Sender property is a bit confusing, and should probably be deprecated and eventually removed. What it does is set's the CKX-Bounce-Address header field. Any header field beginning with "CKX-" is automatically removed from the email when SendEmail is called. The purpose of CKX-Bounce-Address is to use it as the "reverse path" for sent email. This is the argument to the "MAIL FROM" command in the SMTP protocol exchange. (It is NOT the "From" email header.)

See http://www.cknotes.com/smtp-protocol-in-a-nutshell/ Also see a sample SMTP session: http://www.hobgoblinconsulting.com/hints/smtp.html

I don't know what email header fields would correspond to "on behalf of", but I Googled the word "behalf" in combination with other pertinent terms and found this: https://tools.ietf.org/html/rfc4021

See sections "2.1.15. Header Field: Resent-From" and so-on. Any header field can be added to an email via the email.AddHeaderField method..

link

answered Nov 26 '15 at 14:14

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

When there is both a "From:" and "Sender:" in the email header. Outlook will present in the From: {sender} on behalf of {from}

This behavior can be created and seen in Outlook 2010.

The Gmail web and Android interface do not show this "on behalf", nor does it show the "sender" information (without looking at all the headers).

This might be a Microsoft only implementation.

You're "Sender" option doesn't set the "Sender" header?

link

answered Nov 30 '15 at 10:19

TracyP's gravatar image

TracyP
1062

Thanks Tracy! I know it's confusing about the "Sender" property, but it can't be changed without breaking backward compatibility. (Perhaps in a major new version w/ explicit notes on backward compatibility issues..)

To set the "Sender" header, one would call email.AddHeaderField("Sender","...")

link

answered Nov 30 '15 at 10:23

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2

Asked: Nov 26 '15 at 14:05

Seen: 717 times

Last updated: Nov 30 '15 at 10:23

Related questions

powered by OSQA