paintballrefjosh / MaNGOSWebV4

This is a continuation of the MaNGOSWebV3 project.
GNU General Public License v3.0
32 stars 48 forks source link

Mail relay should also have MiME (php mail() function) #48

Closed Albirew closed 6 years ago

Albirew commented 7 years ago

advantage of mail() is that there is no need for any account or painfull configuration. mails are forged this way:

$to      = 'user1@example.com, user2@example.com';
$subject = 'the subject';
$message = 'Hello, world.<br>';
// To send HTML mail, the Content-type header must be set
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=utf-8';
$headers[] = 'To: User1 <user1@example.com>, User2 <user2@example.com>';
$headers[] = 'From: MaNGOSWebV4 <website@example.com>';
$headers[] = 'Reply-To: webmaster@example.com';
$headers[] = 'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, implode("\r\n", $headers));
paintballrefjosh commented 6 years ago

I don't have any plans to add the built in PHP Mail() function due to its limitations. That's why I included a more advanced open source Mail class to handle many options.