The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cannot send email from php usin phpmailer class

Discussion in 'E-mail Discussions' started by carcaras3, Jul 5, 2012.

  1. carcaras3

    carcaras3 Registered

    Joined:
    Jul 5, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Armenia, Colombia
    cPanel Access Level:
    Website Owner
    I'm trying to use phpmailer class to send emails in the site but got the following server errors, any help will be really appreciated.
    Code:
    SMTP -> FROM SERVER:220-serv01.siteground260.com ESMTP Exim 4.77 #2 Thu, 05 Jul 2012 17:19:27 -0500 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
    SMTP -> FROM SERVER: 250-serv01.siteground260.com Hello exclusivecarauto.com [184.154.224.17] 250-SIZE 52428800 250-AUTH LOGIN PLAIN 250-STARTTLS 250 HELP
    SMTP -> FROM SERVER:250 OK
    SMTP -> FROM SERVER:550-(exclusivecarauto.com) [184.154.224.17]:58097 is currently not permitted to 550-relay through this server. Perhaps you have not logged into the pop/imap 550-server in the last 30 minutes or do not have SMTP Authentication turned on 550 in your email client.
    SMTP -> ERROR: RCPT not accepted from server: 550-(exclusivecarauto.com) [184.154.224.17]:58097 is currently not permitted to 550-relay through this server. Perhaps you have not logged into the pop/imap 550-server in the last 30 minutes or do not have SMTP Authentication turned on 550 in your email client.
    SMTP Error: The following recipients failed: yoursitetester@hotmail.com Mailer Error: SMTP Error: The following recipients failed: yoursitetester@hotmail.com
    
    SMTP server error: (exclusivecarauto.com) [184.154.224.17]:58097 is currently not permitted to 550-relay through this server. Perhaps you have not logged into the pop/imap 550-server in the last 30 minutes or do not have SMTP Authentication turned on 550 in your email client. 
    Here is a copy of the code I'm using, I know this is not a programmers forum but this problem have my head about to explode.

    PHP:
    $mail = new PHPMailer(); // the true param means it will throw exceptions on errors, which we need to catch
                    
                    
    $mail->IsSMTP(); // telling the class to use SMTP
                    
                    
                          
    $mail->Host       "mail.mysite.com"// SMTP server
                          
    $mail->SMTPDebug  2;                     // enables SMTP debug information (for testing)
                          
    $mail->AddReplyTo('admin@mysite.com''ExclusiveCarAuto.com');
                          
    $mail->AddAddress('yoursitetester@hotmail.com''Your Site Tester');
                          
    $mail->SetFrom('admin@mysite.com''ExclusiveCarAuto.com');
                          
    //$mail->AddReplyTo('name@yourdomain.com', 'First Last');
                          
    $mail->Subject 'Subject line';
                          
    $mail->AltBody 'To view the message, please use an HTML compatible email viewer!'// optional - MsgHTML will create an alternate automatically
                          
    $mail->MsgHTML("Contenido del correo.");
                          
    //$mail->AddAttachment('images/phpmailer.gif');      // attachment
                          //$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
                          
    if(!$mail->Send()) {
                          echo 
    "Mailer Error: " $mail->ErrorInfo;
                        } else {
                          echo 
    "Message sent!";
                        }

    Maybe someone could ponitme to the options I have to change in the cpanel to get this working, if it's a cpanel problem.

    Thanks in advance.
    Forgive my bad english
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Does this domain name have it's normal email handled through this server, or a remote mail server? The error message you provided can sometimes indicate the domain name does not have it's email routing setup properly. If the domain name has it's email handled on a remote mail server, check to see if it's in the following file:

    Code:
    # /etc/remotedomains
    Thank you.
     
Loading...

Share This Page