Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email sending problem

    I made a simple Html form which takes user mail info and message and send it.I hav made another php script for the mail to be sent. My code is given below-
    PHP Code:

    <?php
    echo "Thank You <b>$_POST[name]</b> for ur message";
    echo 
    "<p>Your mail address is <p>$_POST[email] </p>";
    echo 
    "<p>Your message was <p> $_POST[msg] </p>";
    //building the message.
    "$msg="Name$_POST[name]n";
    $msg.="
    E-mail $_POST[email]n";
    $msg.="
    Message $_POST[msg]n";
    //set up mail
    $subject="
    Tanvirs Form Submission Results";
    $recepeint="
    bhonest_4ever@yahoo.com";
    $mailheader="
    FromTanvirs House <tanvirtonu@yahoo.com>n";
    $mailheader.="
    Reply to $_POST[email]";
    //send the mai
     
    mail($recepeint,$subject,$msg,$mailheader);



    ?>
    my HTML form code is-

    Code:
    <html>
    <head>
    <title>EmailFORM</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <form action="Email.php" method="post">
    <p>Your Name</p>
    <input type="text" name="name">
    <p>Mail Address</p>
    <input type="text" name="email">
    <p>Message</p>
    <textarea name="msg" cols="30" rows="10"></textarea>
    <p>
    <input type="submit" value="Send" >
    </p>
    
    </form>
    </body>
    </html>
    But when I press send button, I cant send the mail, Is says-

    " 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 D:\xampp\htdocs\Email.php on line 24 "

    WHAT IS D PROBLEM.How can I know which smtp port my ISP is using.In php.ini file the port value is 25.
    What shud I do.pls help.
    Edit/Delete Message Reply With Quote Multi-Quote This Message Quick reply to this message
    Last edited by tanvirtonu; 11-04-2007 at 03:34 PM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    PHP Code:
    $msg="Name: $_POST[name]\n";
    $msg.="E-mail $_POST[email]\n";
    $msg.="Message $_POST[msg]\n"
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    You could call your ISP or use a nifty little site called Google.


  •  

    Posting Permissions

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