Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End SMTP problem in Contact Page

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #31531
    nimaOL
    Member

    I’m almost done designing my very first website… about to put it into wordpress…

    Today I watched the #21 Video about Contact Page and started mine…
    In my Contact page I want to test my mail function to see if that works, I use WAMP and when I click on Submit button it 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 C:wampwwwhtmlcontactengine.php on line 30

    My codes:
    HTML:


































    And PHP page:

    
    
    // CHANGE THE VARIABLES BELOW

    $EmailFrom = "[email protected]";
    $EmailTo = "[email protected]";
    $Subject = "Contact Form Submission";

    $Name = Trim(stripslashes($_POST));
    $Email = Trim(stripslashes($_POST));
    $Message = Trim(stripslashes($_POST));

    // prepare email body text
    $Body = "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "n";
    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "n";
    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "n";

    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

    // redirect to success page
    // CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE

    if ($success){
    print "";
    }
    else{
    print "";
    }

    ?>

    I need to set it up on my Gmail account… Please help me with it, it took my whole day after checking tons of tutorials :(

    #62511
    TheDoc
    Member

    There’s probably nothing wrong, it’s just that WAMP isn’t set up to handle mail requests like that. Try uploading it to your server and test it there.

    If you want to remain testing it locally, just search for ‘mail function wamp’ or something similar, you should find some instructions on setting it up!

    #62518
    nimaOL
    Member

    Hi TheDoc, thanks for replying…
    I’ve already searched lots of words but didn’t find such a thing! Maybe I should change WAMP to something else…

    I have no server to upload at this time, I won’t get a server until I finished my website completely.

    I wonder if that can happen with WordPress, can I have my designed form accordingly and install a plug-in and then place the elements inside my HTML like Category

    ?

    #62485
    TheDoc
    Member
    #62476
    nimaOL
    Member

    Already tried, doesn’t work for me.

    #61953
    gno
    Member

    Use the swiftmailer.org library and send emails using an external smtp server – e.g. the one from your gmail or similar. :-)

    #61594
    nimaOL
    Member

    Thanks for replying gno, I already tried that too but it was confusing and didn’t send emails after I set up smtp server, but the “Failed to connect to mailserver” error was disappeared, somehow I will give it another shot… thanks again :)

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.