Answer the question
In order to leave comments, you need to log in
How to configure smtp?
<?php
function Send_Mail($to,$subject,$body)
{
require 'class.phpmailer.php';
$from = "[email protected]";
$mail = new PHPMailer();
$mail->IsSMTP(true);
$mail->IsHTML(true);
$mail->SMTPAuth = true;
$mail->Host = "tls://smtp.yourwebsite.com";
$mail->Port = 465;
$mail->Username = "SMTP_Username";
$mail->Password = "SMTP_Password";
$mail->SetFrom($from, 'From Name');
$mail->AddReplyTo($from,'From Name');
$mail->Subject = $subject;
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, $to);
$mail->Send();
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question