2014-01-25 2 views
1

Когда я пытаюсь отправить почту с помощью mandrill с помощью этого метода PHPMailer, он показывает ошибку, поскольку SMTP Connect() Failed. Это мой код:Mandrill PHPMailer, дающий ошибку: SMTP Connect() не удалось

<?php   
    require 'class.phpmailer.php';  
    $mail = new PHPMailer; 
    $mail->IsSMTP();   
    $mail->Host = 'smtp.mandrillapp.com';  
    $mail->SMTPSecure = 'tls';      
    $mail->Port = 587;          
    $mail->SMTPAuth = true;         
    $mail->Username = 'MANDRILL_USERNAME';     
    $mail->Password = 'API_KEY';      
    $mail->From = '[email protected]'; 
    $mail->FromName = 'Your From name'; 
    $mail->AddAddress('[email protected]');     
    $mail->IsHTML(true);        
    $mail->Subject = 'Here is the subject';   
    $mail->Body = 'This is the HTML message body <strong>in bold!</strong>';  
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';  
    if(!$mail->Send()) {   
     echo 'Message could not be sent.';   
     echo 'Mailer Error: ' . $mail->ErrorInfo;  
     exit; 
    }  
    echo 'Message has been sent'; 
?> 

Я не смог найти эту проблему. Я также включил файлы phpmailer, из которых был доставлен файл class.phpmailer.php. Пожалуйста, помогите ...

ответ

2

Ошибка SMTP-соединения часто связана с тем, что хостинг-провайдер или интернет-провайдер блокируют используемые вами порты. У нас есть дополнительная информация в Mandrill KB об этом с инструкциями по устранению неполадок:. Why am I getting a "Relay Access Denied" error trying to send through SMTP?

2

:( Original Answer

GoDaddy has several limitations for its shared-hosting plans.

If you're trying to send emails from the GoDaddy host, you'll need to use the following SMTP server:

relay-hosting.secureserver.net Also, keep in mind that the GoDaddy SMTP servers are very busy, which means it might take some time until your email sent to its recipient.

Don't waste your time and try to configure other SMTP servers (Gmail etc) to handle your outgoing emails. GoDaddy has blocked this option and limited it only to the mentioned server above.

Read here: GoDaddy costumer service answer

Если ссылка еще работает ... повезло вам

Смежные вопросы