Safe way to send mail via PHP to many users

后端 未结 7 1548
青春惊慌失措
青春惊慌失措 2021-01-30 09:41

Let me explain what I mean in my title. Let\'s say, that for example I\'m creating a small e-commerce system for one web shop/catalog. There\'s a possibility for customers to ch

7条回答
  •  春和景丽
    2021-01-30 10:32

    Just use PHP Mail and study IMF and how to build custom headers you can attach the fourth parameter, exmaple follows

    
       ...
    
    ';
    
    // 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: Mary , Kelly ' . "\r\n";
    $headers .= 'From: Birthday Reminder ' . "\r\n";
    $headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
    $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
    
    // Mail it
    mail($to, $subject, $message, $headers);
    ?>
    

    Source: http://php.net/manual/en/function.mail.php

提交回复
热议问题