Jump to content

pass form variables straight to email, no database required?


bossman

Recommended Posts

hello all,

 

im working on this form...

 

http://www.adobedayevents.com/project_request/project_request.php

 

What we want to use this form for, is for our client Adobe, to have there field marketing managers fill out this form, and have it generate an email that is then sent to my project supervisor here at our company.

 

Is there a way to pass ALL of these variables straight into an email, without having to insert them into a database first? If you look at the bottom, there is form fields for the user to upload files for us. Will we be able to pass those to the email as well, no database?

 

Any advice is appreciated, and if anyone can paste some links to some tutorials or other posts in here that fall under what im trying to do that would be great. I've tried searching this forum but couldn't find anything that helped me. THANKS!!

Short answer... Yes.

 

It's not just possible, it's the only sensible way of doing it, you only use a database if you wish to store the data, if you simply want to e-mail it there would be no sense in using a database. Simply insert the values from the $_POST array into the body text of the e-mail. Any tutorial on sending an e-mail in PHP will give you most information. Attaching the e-mail will be a touch more work but still not too hard.

 

A two second search on google brought up...

 

http://www.webcheatsheet.com/php/send_email_text_html_attachment.php

Indeed, it can sometimes be difficult to know what to search for.

 

Not really no. If you have an input element called "gender" as a drop-down box then the value of $_POST['gender'] will be the value of the selected <option> node. With a checkbox it will only be submitted if the checkbox is actually checked. So you may wish to use....

 

if(isset($_POST['input_name'])) {
   // add data to e-mail here
}

 

... to avoid notices.

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.