SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mail sending failed

    Hi Guys

    I am getting the following error while sending the mail.

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in mysitepath\test\mail.php on line 12

    Please guide me.
    Barbara

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    does exactly whats saying on the tin. Are you running this on your web server, or a local server?

    Basically if you hadn't guessed its saying that your php is setup to send emails via your localhost. But it seems your localhost does not have an SMTP server running.


  3. #3
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    North Richmond
    Posts
    495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not too sure if this is right but I'll give it a go...

    If you are running your file from a localserver then you need to access your php.ini file. Within the file you will find:
    Code:
    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25
    
    ; For Win32 only.
    ;sendmail_from = me@example.com
    You need to correct it so your SMTP = mail.yourISP.com.
    (yourISP is the name of your Internet Service Provider eg. mail.optusnet.com.au)

    Otherwise, if you are running from a host, then they will be the ones who have access to the php.ini file and it should be configured for you.

    Hope this helps...(I could be wrong so don't take it as gospel)
    Last edited by BJ Duncan; Aug 11, 2007 at 06:06. Reason: adding comments
    Regards,
    BJ Duncan

  4. #4
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks guys

    I use ini_set() function to set SMTP in my mail.php.
    But now I am getting another error

    Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for myemail@yahoo.com in mysitepath\test\mail.php on line 14

    please help me.
    Barbara

  5. #5
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    North Richmond
    Posts
    495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Regards,
    BJ Duncan

  6. #6
    SitePoint Evangelist barbara1712's Avatar
    Join Date
    Apr 2007
    Location
    India
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot,
    But before following the steps I want to clease doubt.
    I am using apache,so making changes ti IIS , does it affect anything.
    Barbara

  7. #7
    SitePoint Evangelist BJ Duncan's Avatar
    Join Date
    Jun 2007
    Location
    North Richmond
    Posts
    495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not absolutely certain of the answer to that, however, if you are working on a local server, what's the harm in giving the tutorial a trial to see if works. If it doesn't just change the settings back to what they were.

    It's all about the trial and error - that's the way to not only learn, but also to understand.

    Best of luck though - please let us know of the outcome if you do try it.
    Regards,
    BJ Duncan


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •