Whenever I send an e-mail to my clients, their mailbox shows the e-mail particulars of my server that's hosting this site, rather than the e-mail I mention within the
from variable. something similar to this
From John Smith firstname.lastname@example.orgService.com
Things I want is
Assistance will be appreiated. I'm unaware whether it's a question more appropriate for mentioning in Serverfault. If that's the case, then tell me.
$to = 'email@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: firstname.lastname@example.org' . "\r\n" . 'Reply-To: email@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers);
What Narek states sometimes works, but type of is dependent from the configurations. I'd a simular problem previously using mail() and whatever i attempted, i sometimes got the hostname. It made an appearance to become a server(configurations) problem.
What did assist me to, was using Swiftmailer over SMTP ( http://swiftmailer.org/ ) rather. You need to try it out, it is a excellent script.