1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Rep Power

    Exclamation Sending mail from php file

    i am working on a website in which user will fill a form and on click of submit button a mail will be sent to a particular email id..i am doing like this :

    <form method="post" action="sendmail.php">
    Email: <input name="email" type="text" />
    <textarea name="message" rows="10" cols="30">
    <input type="submit" />

    $email = $_POST['email'] ;
    $message = $_POST['message'] ;
    mail ("thakurit07@gmail.com", "Feedback form results", $message, "From: $email") ;
    print "Congratulations your email has been sent";

    on click of submit button ...
    i am getting 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\ims\sendmail.php on line 12
    Congratulations your email has been sent

    can any one help....
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Rep Power
    Wow, that's a puzzler. No one's EVER seen that one before!
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!

IMN logo majestic logo threadwatch logo seochat tools logo