Geeks With Blogs

News

qrcode

Lance Robinson

Create Your Badge

Lance Robinson is a software engineer in Durham, Chapel Hill, Raleigh, and surrounding areas. More about Lance.

 Subscribe


Lance's TextBox » About Me » My Resume »Twitter

When you get an email from a yahoo group list, for example, it might say it was sent from yourgroup@yahoogroups.com on behalf of the person who actually sent it.  Both addresses will be included in the message.

This is done in SMTP with the SENDER header.  If the Sender header is present, the email client should identify the mail as being "from" the sender you specify in the SENDER header (they are "the responsible mail submitter"), on behalf of the from-address that you specify in the FROM header.  You can do it with IP*Works! by simply adding the SENDER header (which is not the same as the FROM header) using the OtherHeaders property, ie:

smtp.OtherHeaders = "Sender: sender-address@mydomain.com";
So, to send an email from test@mylist.com on behalf of the someuser@somedomain.com, just say: 
smtp.OtherHeaders = "Sender: test@mylist.com"; 
smtp.From = "someuser@somedomain.com";
smtp.SendTo = "test@nsoftware.com";
smtp.Subject = "SendOnBehalfOf";
smtp.MessageText = "message text";
smtp.Connect();
smtp.Send();
You can use the OtherHeaders property to specify any custom headers you'd like, multiple headers should be separated with a CRLF.
Technorati Tags: ,
Posted on Tuesday, February 26, 2008 4:38 PM Programming | Back to top


Comments on this post: Sending Email On Behalf Of

# re: Sending Email On Behalf Of
Requesting Gravatar...
Exactly what I needed to avoid mail from background mechanisms being filtered by m$-outlook spam filter. Thank you!
Left by StarLight on Dec 09, 2008 5:40 AM

# re: Sending Email On Behalf Of
Requesting Gravatar...
Could the opposite be done, remove the "sender" tag?
Here is the situation. Our organization just switched to Google Apps. We own a few domains and have pulled them into Google Apps as well. So our main domain is www.domain.com as an example. This is what the actual google apps account is.
We then have our other domains added in as aliases, like www.otherdomain.com. This allows our users to receive e-mails sent to either domain, and also they can send out from either domain if we grant them this access.
This works fine for sending directly within Google Apps, e-mails are received showing the chosen "from" address. However, some users have to use outlook or other desktop clients to send. For those people, if they choose to send as a user @ one of the alias domains, Outlook adds the "Sender" field to the header, which causes some recipients to see "from user@domain.com on behalf of user@otherdomain.com".
I know this is done for fighting spam, but since we own both domains and have MX setup properly this should be OK.
So, after that long drawn out explanation, can ipworks be used to delete that sender line from the header?
My basic thought is we'd configure our users on outlook to send to an ipworks server which would remove that header and then pass along the message to google apps.
Left by GreenEnvy on Dec 09, 2008 10:26 AM

# re: Sending Email On Behalf Of
Requesting Gravatar...
Yeah, IPWorks can send email with any header fields and values you want to specify. You can have complete control over the headers if you want to. However, we don't have a pre-built smtp server, so while you could built one with IPDaemon to receive emails and then immediately re-send them, you'd have to do that dev yourself. SMTP is an extremely simple protocol though, so it wouldn't be too tough of a job.
Left by Lance on Dec 09, 2008 10:34 AM

# re: Sending Email On Behalf Of
Requesting Gravatar...
Great! I need to use this. I am planning to build a bulk email application for clients.

I have yet to try it, though. Hope it works.
Left by Steve Cameron on Sep 18, 2010 9:19 AM

Your comment:
 (will show your gravatar)


Copyright © Lance Robinson | Powered by: GeeksWithBlogs.net