PHP Send HTML mail

前端 未结 3 624
情话喂你
情话喂你 2021-01-26 21:46

I am trying to send an HTML mail through PHP, but I can\'t seem to get it working.

This is my code:

    // multiple recipients
    $to  = \'mail\';

             


        
3条回答
  •  盖世英雄少女心
    2021-01-26 22:43

    Fixed.

    I found this which for some reason worked perfectly on my server:

    // Set The Headers:
    $headers        =   'From: "Me" '.PHP_EOL.
    'Reply-to: '.PHP_EOL.
    'Cc: '.PHP_EOL.
    'MIME-Version: 1.0'.PHP_EOL.
    'Content-type: text/html; charset=iso-8859-1'.PHP_EOL.
    'Content-Transfer-Encoding: 8bit'.PHP_EOL.
    'X-Mailer: PHP/'.PHP_VERSION.PHP_EOL;
    // Send:
    mail($to, $subject, $message, $headers);
    

    Thanks for the input guys.

提交回复
热议问题