phpmailer error

Posted on 2006-04-18
Last Modified: 2008-02-01

m getting the following error when trying to send an email with phpmailer

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/aigf002/libs/class.smtp.php on line 105

Warning: fsockopen(): unable to connect to in /home/aigf002/libs/class.smtp.php on line 105
Message was not sent

I can tell you that it was working when I had the smtp turned off, The smtp class is in the include directory, but im not sure if they smtp information is correct. (eg username/password/server) could this error be produced because i have the config info wrong... or is it something else?

Question by:antum
    LVL 6

    Expert Comment

    This can be. Check username/password/server.
    And please, show me line 105 from your /home/aigf002/libs/class.smtp.php
    LVL 12

    Expert Comment

    you can have the servername as localhost if you donot know the smtp server name...

    for the username and password use the one provided for authentication. or you can use the POP email account and password i think....

    Author Comment


    Set the server to localhost and tried the main login and password for the account but now I get this error message

    Message was not sent

    Mailer Error: Language string failed to load:

    LVL 6

    Accepted Solution

    The same bug was discussed on SourceForge's phpmailer project page ( ). There you'll find the solution (hope it help you):
    $mail->Host     = "";
    $mail->Mailer   = "smtp";

    Also there is a discussion on similar phpmailer error here ( ) But the problem in that post was in configuration under Win32. But there was a lot of versions of how to fix problem, maybe something from that discussion will help you.

    And there are described another similar problem on SitePoint ( ). Maybe this can help too.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to count occurrences of each item in an array.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now