没有通过phpmailer发送电子邮件 [英] Emails not being sent via phpmailer

查看:110
本文介绍了没有通过phpmailer发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我接管了一家公司的网站开发,他们在几页上有一份反馈表(科罗拉多普雷斯科特旗杆怀俄明州)使用PHPmailer将表单信息作为垃圾邮件过滤器提交给电子邮件。但是,他们没有按照他们希望的方式接收电子邮件。我可以通过所有 addAddress 电子邮件收到电子邮件,但使用 $ recipient 的电子邮件除外。



 $ colorado = array(ColoradoSprings,Denver,Boulder); 
$ colorado = array_map('strtolower',$ colorado);

$ wyoming = array(Cheyenne,Buffalo);
$ wyoming = array_map('strtolower',$ wyoming);

if(in_array($ _POST ['location'],$ colorado)|| in_array($ _POST ['location'],$ wyoming))
$ recipient =person1 @ mail .com,person2 @mail.com;

开关($ _POST ['location']){
caseprescott:
$ recipient =person3@mail.com,person4@mail.com;
休息;
caseflagstaff:
$ recipient =person3@mail.com,person4@mail.com;


$ mail = new PHPMailer;
$ mail-> isSMTP();
$ mail-> SMTPDebug = 0;
$ mail-> Debugoutput ='html';
$ mail-> Host ='smtp.mail.com';
$ mail-> Port = 587;
$ mail-> SMTPSecure ='tls';
$ mail-> SMTPAuth = true;
$ mail-> Username =senderemail@mail.com;
$ mail->密码=密码;
$ mail-> setFrom('allmail@mail.com','Everyone');
$ mail-> addReplyTo($ _POST [Email],$ _POST [Name]);
$ mail-> addAddress('allmail@mail.com','Everyone');
$ mail-> addAddress('random@mail.com','John Doe');
$ mail-> addAddress($ recip,'Others');





我尝试过:



搜索并尝试了我能想到的一切,包括爆炸 foreach 以及其他代码。无法让这个工作。一点帮助就会很棒。

解决方案

收件人。



 


colorado = array(ColoradoSprings,Denver,Boulder);


colorado = array_map('strtolower',

I took over the web development for a company and they've got a feedback form on a couple pages (colorado, prescott, flagstaff and wyoming) that submits form info to an email as a spam filter using PHPmailer. However, they're not receiving emails the way they hoped. I can get emails through all addAddress emails except for the one using $recipient.

$colorado = array( "ColoradoSprings", "Denver", "Boulder" );
$colorado = array_map( 'strtolower', $colorado );

$wyoming = array( "Cheyenne", "Buffalo" );
$wyoming = array_map( 'strtolower', $wyoming );

if ( in_array( $_POST[ 'location' ], $colorado ) || in_array( $_POST[ 'location' ], $wyoming ) )
    $recipient = "person1@mail.com, person2@mail.com";

switch ( $_POST[ 'location' ] ) {
    case "prescott":
        $recipient = "person3@mail.com, person4@mail.com";
        break;
    case "flagstaff":
        $recipient = "person3@mail.com, person4@mail.com";


        $mail = new PHPMailer;
        $mail->isSMTP();
        $mail->SMTPDebug = 0;
        $mail->Debugoutput = 'html';
        $mail->Host = 'smtp.mail.com';
        $mail->Port = 587;
        $mail->SMTPSecure = 'tls';
        $mail->SMTPAuth = true;
        $mail->Username = "senderemail@mail.com";
        $mail->Password = "password";
        $mail->setFrom( 'allmail@mail.com', 'Everyone' );
        $mail->addReplyTo( $_POST[ "Email" ], $_POST[ "Name" ] );
        $mail->addAddress( 'allmail@mail.com', 'Everyone' );
        $mail->addAddress( 'random@mail.com', 'John Doe' );
        $mail->addAddress( $recipient, 'Others' );



What I have tried:

Searched and tried everything I could think of including explode and foreach and other codes. Can't get this to work. A little help would be great.

解决方案

recipient.


colorado = array( "ColoradoSprings", "Denver", "Boulder" );


colorado = array_map( 'strtolower',


这篇关于没有通过phpmailer发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆