Sologet Forum
How to Stop Sending E-Mail Spam using PHP mail function - Printable Version

+- Sologet Forum (https://www.sologet.com)
+-- Forum: Programming (https://www.sologet.com/Forum-Programming)
+--- Forum: PHP Programming & Tutorials (https://www.sologet.com/Forum-PHP-Programming-Tutorials)
+--- Thread: How to Stop Sending E-Mail Spam using PHP mail function (/Thread-How-to-Stop-Sending-E-Mail-Spam-using-PHP-mail-function)



How to Stop Sending E-Mail Spam using PHP mail function - Kingsolomon - 10-31-2018

The mail() function included with stock PHP does not support SMTP authentication, for example. If mail() does not work for you then for this or another reason, try the PHPMailer package, which is much more comprehensive while maintaining, to a large extent, the simplicity and ease of mail() for sending mail from PHP. Mark the following points then proceed to code.

Code

Code:
$subject = "Test";
$to = "sologetforum@gmail.com";
$msg = "Type Your Message";

$headers='From: info@bladephp.co \r\n';
$headers.='Reply-To: info@bladephp.co\r\n';
$headers.='X-Mailer: PHP/' . phpversion().'\r\n';
$headers.= 'MIME-Version: 1.0' . "\r\n";
$headers.= 'Content-type: text/html; charset=iso-8859-1 \r\n';
$headers.= "BCC: info@sologet.com";
$headers.= "CC: info@sologet.com";

mail($to, $subject, $msg, $headers);

change info@sologet.com to your own email


RE: How to Stop Sending E-Mail Spam using PHP mail function - Solomon - 11-12-2018

Nice one Nice