duanheye7423 2019-02-20 03:02
浏览 35

PHPMailer没有发送一些电子邮件[重复]

This question already has an answer here:

I tested my PHPMailer script, but its only receiving emails from certain email addresses.

When I try putting another email address (A dummy address I created) inside the form, its not sending the email.

How do I make it receive emails from all addresses typed into the form

<?php

$result="";

if(isset($_POST['submit'])){
    require 'phpmailer/PHPMailerAutoload.php';
    $mail = new PHPMailer;

    $mail->Host='smtp.gmail.com';
    $mail->Port=587;
    $mail->SMTPAuth=true;
    $mail->SMPTSecure='tls';
    $mail->Username='jerrytesting12345@gmail.com';
    $mail->Password='******';

    $mail->setFrom($_POST['email'],$_POST['name']);
    $mail->addAddress('jerrytesting12345@gmail.com');
    $mail->addReplyTo($_POST['email'],$_POST['name']);

    $mail->isHTML(true);
    $mail->Subject='Bradas Contact: '.$_POST['subject'];
    $mail->Body='Message: '.$_POST['msg'].'</h1>';

    if(!$mail->send()){
        $result='something went wrong';
    } else {
        $result='thank you';
    }
}

?>

</div>
  • 写回答

1条回答 默认 最新

  • duanha3539 2019-02-20 03:16
    关注

    Maybe it is going spam. Since you cannot send emails from others email addresses. You need to set "FROM" your domain e-mail, for example no-reply@yourdomain.com.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度