Hi am new in PHP i need to send email via SMTP using PHP. Actually i did in normal code, but mail land in spam. (Following mycode)
$to = 'xxx@gmail.com';
$subject = 'Test mail';
$from = 'zzz@domain.com';
$header = "From: $from \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '//some HTML Code...';
if (mail($to, $subject , $message, $headers)) {
echo 'Success';
} else {
echo 'Error';
}
So i refer some websites they said using SMTP (Simple Mail Transfer Protocol) mail will land in inbox. Kindly please help me for sending email via SMTP.
Thanks in advance