How to remove “via” and server name when sending mails with PHP?

前端 未结 5 2034
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 03:54

When I send a mail with PHP the destinatary gets a header like this one:

   noreply@justwalk.it **via** de p3nlhg147.shr.prod.phx3.secureserver.net
         


        
5条回答
  •  佛祖请我去吃肉
    2020-11-29 04:39

    I also fetched the same problem. But I have overcome the problem by using the following code:

    mail('maaaa@abcd.com', 'the subject', 'the message', null,'-faaa@abc.com');
    

    Make sure that last parameter is -f with the email address.

    You can add the

    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    mail('maaaa@abc.com', 'the subject', 'the message body in html format', $headers,'-faaaa@abc.com');

    for the html message body in email.

提交回复
热议问题