How can I customize the mail FROM header in our Email Marketing Application , to enable our customers to specify their OWN email ( from their domain ) .
Currently the customer specify his own domain and we use it at the Reply-To mail's header.
CURRENTLY
From: [email protected]
Reply-To: customer_email@customer_domain.com
Return-Path: [email protected]
WHAT WE NEED
From: customer_email@customer_domain.com
Reply-To: customer_email@customer_domain.com
Return-Path: [email protected]
We do it this way to avoid getting blacklisted because Mail Servers like Gmail or Hotmail would considers it as a MAIL'S HEADER FORGERY ATTEMPT.
But our customers keeps asking us to make the FROM HEADER customizable.
Can someone help us ?
There's nothing special you have to do to write your own From: header on an email. I do it all the time for my customer's websites I host on my servers, however, I make sure that my webservers' IP block is in their SPF records.
As long as your customers add your.mail.servers.ipaddress(es) to their SPF records, you shouldn't get a forgery attempt because the SPF records tell the recipient mail server that you're allowed to send mail on their behalf.
EDIT:
To address your comments about "won't they know that it didn't come from their domain?" -- MX records have nothing to do with who's sending the mail, they're used by other sending mail servers to determine where to send email to. Same goes with A records for hosting websites; it has nothing to do with sending mail at all, you can absolutely have your Website hosted at 1.2.3.4, your MX records point to mail.somedomain.com that resolves to 5.6.7.8, and another mail server for outgoing mail only at 9.10.11.12.
Like I said, I do this all the time for many different clients -- they have their own Exchange Servers that sends/receives email, but on my server, their password reminder emails, subscription notifications, forum alerts, newsletters, etc. all have their domain in the From: header (and reply-to:), but since I add my Webserver's IP block to their SPF records for their domains, any receiving mail server goes, "ok, cool, my.webserver.ip.address is permitted to send mail for somecustomer.com; I'll accept mail for delivery".