如何在php中使用SMTP发送电子邮件
我想在我的项目中发送电子邮件,以前我在我的项目中编写,但现在我的客户希望我应该使用.我搜索这个,但我没有得到任何适当的解决方案。SMTP
php mail()
SMTP
在我的我发送名称,主题和评论,所以我如何在.php mail()
SMTP
这是我的代码:
$payer_email = "Your Email";
$subject = "Your Subject";
$message = 'Dear '.$name.',
Thank you for your purchase from '.$site_url.'. The details of your purchase are below.
Transaction ID: '.$txn_id.'
Item Name: '.$item_name.'
Payment Amount: '.$payment_amount.'
Payment Amount: '.$payment_status.'
Paid to: '.$receiver_email.'
Thanks and Enjoy!';
$headers .= 'From: ' .$from. "\r\n" .'Reply-To: ' .$from . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1 ";
//mail to buyer
mail( $payer_email , $subject, $message, $headers );
请给我一些建议或简单而漂亮的教程。