Failed to connect to mailserver

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sujeetha
    New Member
    • Dec 2007
    • 2

    Failed to connect to mailserver

    Hello all,
    We are, a bunch of college students, trying to host a website for our dept symposium. We are using php for web development. We wanted to send a mail for those who have been accepted for a competion. We tried the following php code

    <?php

    $mail_to="recip ientname@gmail. com";
    $mail_from="myn ame@yahoo.com";
    $mail_sub="regi stration result";
    $mail_mesg1="Yo ur request for registration has been accepted. \nLogin to access your account";
    $mail_mesg2="Yo ur request for registration has been denied. \nContact Registeration team or retry with valid details";


    if(mail($mail_t o,$mail_sub,$ma il_mesg1,"From: $mail_from/r/nReply-to:$mail_from") )
    {
    print "<script>window .alert(\"Mail successfully sent\");";
    print "</script>";
    }
    else
    {
    print "<script>window .alert(\"Retry sending\");";

    print "</script>";
    }


    ?>

    we had the corresponding html form too, but anyway we hardcoded the informations. we get this following error,

    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 C:\xampp\htdocs \try\tmail.php on line 16

    We use

    Xampp for php, MySql for database, Windows XP operating system.

    Till what I read from some searches is that we need a mail server and we have to configure that for some settings. We have no idea what mail server to use or where to find. It would be really cool and great if any of you guys could help us.

    Thanks
    Suji
  • Lumpy
    New Member
    • Oct 2007
    • 69

    #2
    Xampp comes with Mercury mail server I think it is. Configure that and make sure that it is running and working. To accomplish this, I would check out the website or something, I don't really know what would all have to be done for this part.

    Once that is done, you may also want to verify your mail function settings in the php.ini, that they match up with your mail server.

    After that, if the mail server is functioning, it should work for you.

    Hope this helps to get you in the write direction.

    Comment

    • Sujeetha
      New Member
      • Dec 2007
      • 2

      #3
      Originally posted by Lumpy
      Xampp comes with Mercury mail server I think it is. Configure that and make sure that it is running and working. To accomplish this, I would check out the website or something, I don't really know what would all have to be done for this part.

      Once that is done, you may also want to verify your mail function settings in the php.ini, that they match up with your mail server.

      After that, if the mail server is functioning, it should work for you.

      Hope this helps to get you in the write direction.
      Hi,

      I tried running the Mercury mail but i got this error. Again I dont have a clue what it means. Thanks for helping me with this stuff.

      SMTP server response: 553 We do not relay non-local mail, sorry. in

      Thanks
      Suji

      Comment

      Working...