0
<?php
function Send_Mail($to,$subject,$body)
{
date_default_timezone_set('Etc/UTC');
require 'class.phpmailer.php';
$from = "[email protected]";
$mail = new PHPMailer();
$mail->IsSMTP(true);
$mail->SMTPAuth = true;
$mail->Mailer = "smtp";
$mail->Host = "tls://smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "";
$mail->Password = "";
$mail->SetFrom($from, 'From Admin');
$mail->AddReplyTo($from,'employee');
$mail->Subject = $subject;
$mail->MsgHTML($body);
$address = $to;
$mail->AddAddress($address, $to);
if(!$mail->Send())
return false;
else
return true;
}
?>
所以我有這些設置,但我不知道要寫在$ mail->用戶名和密碼。我必須寫我的Gmail帳戶和密碼或其他東西嗎?smtp用戶名和密碼在php