duancaoqin6683 2018-06-27 09:13 采纳率: 0%
浏览 15

smtp不适用于G套件帐户

 require 'send/PHPMailerAutoload.php';


  $mail = new PHPMailer();


//Enable SMTP debugging.

  $mail->SMTPDebug = 0;

//Set PHPMailer to use SMTP.

  $mail->isSMTP();

//Set SMTP host name

  $mail->Host = "smtp.gmail.com";

//Set this to true if SMTP host requires authentication to send email

  $mail->SMTPAuth = true;

//Provide username and password

  $mail->SMTPAuth = true;

//Provide username and password

  $mail->Username = "admin@admin.com";

  $mail->Password = "a23k234tbk";

//If SMTP requires TLS encryption then set it

  $mail->SMTPSecure = "tls";


//Set TCP port to connect to

  $mail->Port = 587;

  $mail->From = "admin@admin.com";

  $mail->FromName = "dummy.com";

  $mail->addAddress($user_email);

  $mail->isHTML();

  $mail->Subject = "dummy";

  $mail->Body = $table4 ? $table4 :"";



if($mail->send())
{

  header("Location:email_user.php?result=success");
  echo "";
}
else
{

  echo '';
}
}

So my question is; is their additional configuration that should be done for G suit gmail accounts.

the code works fine the problem only happens when i use a different "from account". When using a normal gmail account like *@gmail.com it works but it fails when using G suit account like *@yourdomainname.com.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)