You can use the following code to send SMTP mail using Php Mailler. After reading our article, you will see that sending SMTP mail is not difficult at all.
Of course, first of all you need to have placed the Click Here PhpMailler class in the folder. I use the class.phpmailler.php, class.smtp.php, and phpunit.php files.
$m1=$_POST['adi_'.$i];
$m2=$_POST['mail_'.$i];
require_once("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.xxx.com";
$mail->SMTPAuth = true;
$mail->Username = "xxx@xx.com";
$mail->Password = "xxx";
$mail->CharSet ="utf-8";
$mail->Encoding="base64";
$mail->From = "xxx@xx.com";
$mail->Fromname = $m1;
$mail->AddAddress($m2,$m2);
$mail->Subject = "xxxx- Onay bilgilendirmesi.";
$mail->Body = ' Merhaba,<br />xxx';
$mail->IsHTML(true);
if(!$mail->Send())
{
echo '<font color="#F62217"><b>Gönderim Hatası: ' . $mail->ErrorInfo . '</b></font>';
exit;
}

Share your experience
Got a question, a different solution or a note to add?
Log in or join us to write a comment.
Log in ↗︎Sign up ↗︎