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 email@example.comService.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 = 'firstname.lastname@example.org'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: email@example.com' . "\r\n" . 'Reply-To: firstname.lastname@example.org' . "\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.