Jump to content

Email form- SMTP setting


Manbhatti

Recommended Posts

I ‘m new to php. I am running XP and installed wamp5 .. I developed a mail form using php mail() function. Some reason it is not firing email . Someone suggested I need a host to this form working, I hosted this file but still this  not worked. I tried various setting, none worked. Anyone know exactly what cofig.  of SMTP setting I need to  make. (I tried various setting still having problem) I will appreciate if some one post  me working script which I can test.

Regards

ManBhatti

 

Link to comment
https://forums.phpfreaks.com/topic/36897-email-form-smtp-setting/
Share on other sites

Following are the codes for HTML form:

 

" <FORM action="5-sendmail.php" method="POST">

<p><strong>Name:</strong><br> <INPUT type="text" size="25" name="name"></p>

<p><strong>E-Mail Address:</strong><br> <INPUT type="text" size="25" name="email"></p>

<p><strong>Message:</strong><br>

<textarea name="message" cols=30 rows=5></textarea></p>

<p><INPUT type="submit" value="send"></p>

</FORM> "

 

These are codes for php processing file

 

"

<?php

echo "<p>Thank you, <b>$_POST[name]</b>, for your message!</p>";

echo "<p>Your e-mail address is: <b>$_POST</b>.</p>";

echo "<p>Your message was:<br>";

echo "$_POST[message] </p>";

//start building the mail string

$msg = "Name:    $_POST[name]\r\n";

$msg .= "E-Mail:  $_POST\r\n";

$msg .= "Message: $_POST[message]\r\n";

//set up the mail

$recipient = "[email protected]";

$subject = "Form Submission Results";

$mailheaders = "From: My Web Site <[email protected]> \r\n";

$mailheaders .= "Reply-To: $_POST";

//send the mail

mail($recipient, $subject, $msg, $mailheaders);

?>

"

Look forward to receive your reply!

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.