我想通过PHP Mailer使用Gmail SMTP服务器发送电子邮件。 这是我的代码 <?php require_once('class.phpmailer.php'); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->CharSet="UTF-8"; $mail->SMTPSecure = 'tls'; $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->Username = 'MyUsername@gmail.com'; $mail->Password = 'valid password'; $mail->SMTPAuth = true; $mail->From = 'MyUsername@gmail.com'; $mail->FromName = 'Mohammad Masoudian'; $mail->AddAddress('anotherValidGmail@gmail.com'); $mail->AddReplyTo('phoenixd110@gmail.com', 'Information'); $mail->IsHTML(true); $mail->Subject = "PHPMailer Test Subject via Sendmail, basic"; $mail->AltBody = "To view the […]