phpmailer error

Discussion in 'PHP' started by kailash, Mar 27, 2008.

  1. #1
    Hi guys,

    I need some urgent help regarding phpmailer script. I have uploaded the class files class.stmp.php and class.phpmailer.php at /usr/local/lib/php/ location but I am getting below error while sending mail through PHP script:

    Warning: fsockopen() [function.fsockopen]: unable to connect to mail.domain.com:25 in /usr/local/lib/php/class.smtp.php on line 105
    Message was not sent

    Mailer Error: Language string failed to load: connect_host

    I am able to connect to mail server using port 25 and fsockopen() is also enabled on the server.

    Did someone face same issue?

    Regards,

    Kailash
     
    kailash, Mar 27, 2008 IP
  2. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #2
    Do the PHPMailer files not need to be in your web root folder? ie above /www/ ?

    Are you on a dedicated server or shared hosting?
     
    Weirfire, Mar 27, 2008 IP
  3. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #3
    I have put the class files in /usr/local/lib/php/ (which is added in include path in php.ini). Hence, there is no need to put these class files in the webroot of the domain.

    Kailash
     
    kailash, Mar 28, 2008 IP
  4. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i haven't used this software but...
    
    Warning: fsockopen() [function.fsockopen]: unable to connect to mail.domain.com:25 in /usr/local/lib/php/class.smtp.php on line 105
    Message was not sent
    
    Code (markup):
    is telling me you are missing a configuration step, it appears that it's trying to connect to "mail.domain.com". i would recommend you get the examples and find out which line you need to set correctly.
     
    powerspike, Mar 28, 2008 IP
  5. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #5
    I managed to resolve this error by downgrading Apache version from 2 to 1.3 and PHP version to 4.4.8. I am not sure whether it was Apache problem or PHP.

    Regards,

    Kailash
     
    kailash, Apr 13, 2008 IP