October 7, 201214 yr I know I can use the 5th param in mail() to pass "-f" before the senders email address. But does anyone know how I can also add in the name of the sender, like - me <me@mydomain.com> I can get it to work it using $headers = 'From: me <me@mydomain.co.uk>' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); but in the email if will show the mail server name like so: Me, me@mydomain.co.uk via sunstorm.3vo.net. So far I have tried "-f me <me@mydomain.co.uk>" for the the 5th mail() param, but the result is - me@sunstorm.3vo.net Any help is appreciated Thanks
October 9, 201214 yr what is your php code ? is it like this : mail($to, $subject, $message, $headers, "-f me@site.com"); I believe only some webmail services show it like that(I know gmail does). @jock even smtp doesn't stop gmail from showing that,you need DKIM signing to hide that . you can use PHPMailer it has built-in support for that, Or you can also use dkim class php which is a lot like phpmailer https://sourceforge....dkim-class-php/ example : include_once('dkim.class.php'); $dkim = new DKIM(); $dkim_header = $dkim -> get_DKIM_header($to, $subject, $message, $headers); mail($to, $subject, $message, $dkim_header.$headers); Edited October 9, 201214 yr by Danny87
Create an account or sign in to comment