How to format an email that Hotmail / Outlook is happy with?

前端 未结 4 1406
星月不相逢
星月不相逢 2021-01-13 00:58
$body = \'This is a test\';
    $subject = \'Confirmation\';
$headers = \'From: Testing Site\' . \"\\r\\n\";
$headers .= \'Reply-To: admin@myserver.com\' . \"\\r\\n\         


        
4条回答
  •  情话喂你
    2021-01-13 01:16

    The From header is invalid. It must have the following syntax:

    From: "name" 
    

    In your case:

    From: "Testing Site" 
    

    The same goes for your Reply-To header:

    Reply-To: "Testing Site" 
    

    Which you can omit if it's the same as the From header (like in your case).

    PS: RFC 2822 doesn't state that the display-name in an address should be quoted. In other words: the following 3 headers should all work:

    From: "Testing Site" 
    From: 'Testing Site' 
    From: Testing Site 
    

提交回复
热议问题