相关疑难解决方法(0)

SMTP Connect()失败.消息未发送.Mailer错误:SMTP Connect()失败

我试图将邮件发送到gmail地址,但它继续收到此错误"SMTP - >错误:无法连接到服务器:连接超时(110)SMTP连接()失败.邮件未发送.Mailer错误:SMTP连接()失败了." 可能是什么问题呢?

        require 'class.phpmailer.php'; // path to the PHPMailer class
        require 'class.smtp.php';

            $mail = new PHPMailer();


            $mail->IsSMTP();  // telling the class to use SMTP
            $mail->SMTPDebug = 2;
            $mail->Mailer = "smtp";
            $mail->Host = "ssl://smtp.gmail.com";
            $mail->Port = 587;
            $mail->SMTPAuth = true; // turn on SMTP authentication
            $mail->Username = "myemail@gmail.com"; // SMTP username
            $mail->Password = "mypasswword"; // SMTP password 
            $Mail->Priority = 1;

            $mail->AddAddress("myemail@gmail.com","Name");
            $mail->SetFrom($visitor_email, $name);
            $mail->AddReplyTo($visitor_email,$name);

            $mail->Subject  = "Message from  Contact form";
            $mail->Body     = $user_message;
            $mail->WordWrap = 50;  

            if(!$mail->Send()) {
            echo …
Run Code Online (Sandbox Code Playgroud)

php email smtp

24
推荐指数
3
解决办法
11万
查看次数

使用GMail和phpMailer发送时"服务器不接受密码:535验证数据不正确"

我在localhost上运行相同的php脚本 - 我的PC与XAMPP和托管服务器上运行.它适用于我的PC,但不适用于托管服务器.

当我从托管服务器发送它时,我得到以下输出:

SMTP -> ERROR: Password not accepted from server: 535 Incorrect authentication data  
SMTP -> ERROR: RCPT not accepted from server: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message. dev.camppage.com 550-(patchvalues.com) [205.234.141.238]:50958 is not permitted to relay through 550 this server without authentication.  
SMTP Error: The following recipients failed: jdorner4@gmail.com FAILED
Run Code Online (Sandbox Code Playgroud)

我怀疑有一个配置设置需要在服务器上更改,但我不知道哪一个.任何建议将不胜感激!

这是代码:

function send_gmail ($recipients, $subject, $message, $attachment_filenames = array()) 
{
  global $email_address, $email_password, $email_name; …
Run Code Online (Sandbox Code Playgroud)

php gmail phpmailer

20
推荐指数
2
解决办法
4万
查看次数

标签 统计

php ×2

email ×1

gmail ×1

phpmailer ×1

smtp ×1