Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to Stop Sending E-Mail Spam using PHP mail function

by
Category:php
php
How to Stop Sending E-Mail Spam using PHP mail function

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. You may also like Download simple HTML email templates and How to Send Emails using HTML and PHP.

Code

$subject = "Test";
$to = "demo@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@bladephp.co";
$headers.= "CC: info@bladephp.co";

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

0 Comments


Html code work in comment box


Related Post