What is the format for e-mail headers that display a name rather than the e-mail?

后端 未结 3 1163
时光取名叫无心
时光取名叫无心 2020-11-29 02:37

I\'m trying to create a php script that will handle a mailing list for me using a mySQL database, and I have most of it in place. Unfortunately, I can\'t seem to get the he

3条回答
  •  余生分开走
    2020-11-29 03:21

        $to = 'SendersName@domain.com';
        $to .=', ' . $_POST['Femail'];
        $subject = 'Contact Us Form';
    
    // message
    $message ="
    
    Email title
    
    
    

    important message follows

    you are being brought this email to be safe.
    "; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: SendersEmailName ' . "\r\n"; $headers .= 'From: YourName ' . "\r\n"; $headers.='X-Mailer: PHP/' . phpversion()."\r\n"; $headers.= "BCC: $emailList"; mail($to, $subject, $message, $headers);

提交回复
热议问题