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
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 = "manbhatti@hotmail.com";

$subject = "Form Submission Results";

$mailheaders = "From: My Web Site <defaultaddress@yourdomain.com> \r\n";

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

//send the mail

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

?>

"

Look forward to receive your reply!

thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.