Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
phpmailer在发送邮件后与服务器断开连接;之后不再运行任何代码_Php_Phpmailer - Fatal编程技术网

phpmailer在发送邮件后与服务器断开连接;之后不再运行任何代码

phpmailer在发送邮件后与服务器断开连接;之后不再运行任何代码,php,phpmailer,Php,Phpmailer,我已经设置了一个php过程,其中包括一个phpmailer send,它在本地机器上运行得很好,但是在send()命令之后它不会运行任何代码 以下是本地运行良好的代码,与我的联系人页面上运行良好的代码几乎相同: $subject = ""; $subject .= "Welcome to Your Strength Coach!"; $body = ""; $body .= " Hi " . $nameFirst . ", <br><br> Welcome to

我已经设置了一个php过程,其中包括一个phpmailer send,它在本地机器上运行得很好,但是在send()命令之后它不会运行任何代码

以下是本地运行良好的代码,与我的联系人页面上运行良好的代码几乎相同:

$subject = "";
$subject .= "Welcome to Your Strength Coach!"; 

$body = "";
$body .= "
Hi " . $nameFirst . ",
<br><br>  
Welcome to <a href=\"https://www.yourstrengthcoach.com/\">Your Strength Coach</a>!
<br><br>
Thank you for signing up. We look forward to being a part of your health and fitness journey.
<br><br>
Be sure to check out the Getting Started section on the Your Account page to get answers to the most common questions we receive. If you have any that aren't answered there, please feel free to email us at anytime. You can reach us at support@yourstrengthcoach.com.
<br><br>  
Thanks again,<br>
Brian Gwaltney, Creator
<br><br>
Be sure to check us out on <a href=\"https://www.facebook.com/YourStrengthCoach1/\">Facebook</a>, <a href=\"https://www.instagram.com/yourstrengthcoach/\">Instagram</a>, and <a href=\"https://www.pinterest.com/yourstrengthcoach/\">Pinterest</a>!";
$mail = new PHPMailer;
    $mail->IsSMTP(); // Use SMTP
    $mail->Host = "smtp.servergrove.com"; // Sets SMTP server
    $mail->SMTPDebug = 2; // 2 to enable SMTP debug information 
    $mail->SMTPAuth = TRUE; // enable SMTP authentication
    $mail->SMTPSecure = "tls"; //Secure conection
    $mail->Port = 587; // set the SMTP port
    $mail->Username = '**'; // SMTP account username
    $mail->Password = '**'; // SMTP account password
    $mail->Priority = 1; // Highest priority - Email priority (1 = High, 3 = Normal, 5 = low)
    $mail->CharSet = 'UTF-8';
    $mail->Encoding = '8bit';
    $mail->Subject = 'New Message from Your Strength Coach Contact Page';
    $mail->ContentType = 'text/html; charset=utf-8\r\n';
    $mail->From = 'info@yourstrengthcoach.com';
    $mail->FromName = 'Your Strength Coach';
    $mail->WordWrap = 900; // RFC 2822 Compliant for Max 998 characters per line

    $mail->AddAddress($email); // To:
    $mail->isHTML(TRUE);
    $mail->Body = $body;
    $mail->Send();

$nextPage = '../profile';
LoginWithCookie($nextPage,$user);
$subject=”“;
$subject.=“欢迎来到您的力量教练!”;
$body=“”;
$body.=”
嗨”$第一名。",


欢迎光临!

感谢您的注册。我们期待着成为您健康和健身旅程的一部分。

请务必查看“您的帐户”页面上的“入门”部分,以获取我们收到的最常见问题的答案。如果您有任何问题没有得到回答,请随时发送电子邮件给我们。您可以通过support@yourstrengthcoach.com.

再次感谢,
布赖恩·格瓦尔特尼,创造者

一定要查看我们,然后!”; $mail=新的PHPMailer; $mail->IsSMTP();//使用SMTP $mail->Host=“smtp.servergrove.com”;//设置SMTP服务器 $mail->SMTPDebug=2;//2以启用SMTP调试信息 $mail->SMTPAuth=TRUE;//启用SMTP身份验证 $mail->SMTPSecure=“tls”//安全连接 $mail->Port=587;//设置SMTP端口 $mail->Username='**';//SMTP帐户用户名 $mail->Password='**';//SMTP帐户密码 $mail->Priority=1;//最高优先级-电子邮件优先级(1=高,3=正常,5=低) $mail->CharSet='UTF-8'; $mail->Encoding='8bit'; $mail->Subject='来自力量教练联系人页面的新消息'; $mail->ContentType='text/html;字符集=utf-8\r\n'; $mail->Frominfo@yourstrengthcoach.com'; $mail->FromName='你的力量教练'; $mail->WordWrap=900;//符合RFC 2822,每行最多998个字符 $mail->AddAddress($email);//致: $mail->isHTML(TRUE); $mail->Body=$Body; $mail->Send(); $nextPage='../profile'; 登录WithCookie($nextPage,$user);
我没有继续使用在创建cookie后重定向的登录函数,而是使用以下方法:

2017-05-28 19:40:03服务器->客户端:220 smtp2.servergrove.com ESMTP 进出口银行2017年5月28日星期日19:40:03+0000 2017-05-28 19:40:03客户 ->服务器:EHLO www.yourstrenghcoach.com 2017-05-28 19:40:03服务器->客户端:250-smtp2.servergrove.com您好www.yourstrenghcoach.com[38.89.161.133] 250号52428800 250-流水线 250-AUTH普通登录 250-STARTTLS 250帮助2017-05-2819:40:03客户端->服务器:开始TLS 2017-05-2819:40:03服务器-> 客户机:220 TLS继续2017-05-28 19:40:03客户机->服务器:EHLO www.yourstrengthcoach.com 2017-05-2819:40:03服务器->客户端: 250-smtp2.servergrove.com您好www.yourstrengthcoach.com [38.89.161.133] 250号52428800 250-流水线 250-AUTH普通登录 250帮助2017-05-2819:40:03客户端->服务器:身份验证登录2017-05-2819:40:03服务器-> 客户端:334 VXNlcm5hbWU6 2017-05-28 19:40:03客户端->服务器: aW5mb0B5b3Vyc3RyZW5ndGhjb2FjaC5jb20=2017-05-28 19:40:03服务器-> 客户端:334 UGFzc3dvcmQ6 2017-05-28 19:40:03客户端->服务器: MEJpZ1NlY3JldCk=2017-05-2819:40:04服务器->客户端:235 身份验证成功2017-05-2819:40:04客户端->服务器:邮件 发件人:2017-05-2819:40:04服务器-> 客户机:250正常2017-05-2819:40:04客户机->服务器:RCPT 收件人:2017-05-2819:40:04服务器->客户端:250 已接受2017-05-28 19:40:04客户端->服务器:数据2017-05-28 19:40:04服务器->客户端:354输入消息,以“.”结尾 线路本身2017-05-28 19:40:04客户端->服务器:日期:5月28日星期日 2017 19:40:03+0000 2017-05-28 19:40:04客户端->服务器:收件人: brian@rosevillesc.com2017-05-28 19:40:04客户端->服务器:发件人:您的 力量教练2017-05-2819:40:04客户 ->服务器:主题:来自力量教练联系人的新消息页面2017-05-28 19:40:04客户->服务器:消息ID: 2017-05-28 19:40:04客户端->服务器:X优先级:1 2017-05-28 19:40:04客户端->服务器:X-Mailer:PHPMailer 5.2.23 ()2017-05-2819:40:04客户-> 服务器:MIME版本:1.0 2017-05-28 19:40:04客户端->服务器: 内容类型:text/html;charset=UTF-8 2017-05-28 19:40:04客户-> 服务器:2017-05-2819:40:04客户端->服务器:2017-05-28 19:40:04客户端->服务器:你好,布莱恩,2017-05-28 19:40:04客户端-> 服务器:

2017-05-28 19:40:04客户端->服务器:欢迎来到您的力量教练! 2017-05-28 19:40:04客户端->服务器:

2017-05-28 19:40:04客户端->服务器:感谢您的注册。我们期待着 成为你健康和健身旅程的一部分。2017-05-28 19:40:04客户端->服务器:

2017-05-28 19:40:04客户端-> 服务器:请务必查看网站上的“入门”部分 账户页面,获取我们收到的最常见问题的答案。 如果您有任何问题没有得到回复,请随时发送电子邮件 随时欢迎我们。你可以在support@yourstrengthcoach.com. 2017-05-28 19:40:04客户端->服务器:

2017-05-28 19:40:04客户端->服务器:再次感谢,
2017-05-28 19:40:04客户端->服务器:Brian Gwaltney,创建者2017-05-28 19:40:04客户端->服务器:

2017-05-28 19:40:04客户端-> 服务器:请务必在Facebook、Instagram和 ! 2017-05-2819:40:04客户端->服务器:2017-05-2819:40:04客户端-> 服务器:。2017-05-28 19:40:04服务器->客户端:250确定 id=1dF42m-00015y-51 2017-05-28 19:40:04客户端->服务器:退出 2017-05-28 19:40:04东南欧
2017-05-28 19:40:04 SERVER -> CLIENT: 250 OK id=1dF42m-00015y-51