Jump to content

Generating email from form submit


Bud M

Recommended Posts

I'm a novice web designer. I'm using a Dreamweaver plug in called Form2Mail that generates a php file that sends the form results to the website owner. They would also like the form to automatically send an acknowledgement email to the email address in the form. It would also be nice to incorporate other form info into the email message like their name and the event they are attending. Can I modify the php to send this second email? Or can I link a 2nd php script to this form to do this?

 

For example:

 

mailto

 

from [email protected]

 

Dear [name field value]'

 

Thank you for registering for [event field value]

 

I'd appreciate any help I can get on this!

 

 

Link to comment
https://forums.phpfreaks.com/topic/145844-generating-email-from-form-submit/
Share on other sites

This is something I took off W3schools

<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ; 
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail( "[email protected]", "Subject: $subject",
  $message, "From: $email" );
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text' /><br />
  Subject: <input name='subject' type='text' /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?>

</body>
</html>

LINK: here

If you need help, just let me know.

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.