Send Emails with a Web Form: PHP Scripting

13 04 2011

Check this video out at Hi-Res here: http://www.tutvid.com Files are Located here: http://www.tutvid.com In the following tutorial we will start with a few html files and we will build an Email Handling PHP script that sends info from your web form to your email! It is pretty easy PHP so enjoy learning and Have fun! I am using Dreamweaver CS3, but you can use pretty much any version of Dreamweaver, just follow closely and try not to make mistakes. Please enjoy and don’t forget to check out the site http://www.tutvid.com
Video Rating: 4 / 5


Actions

Information

25 responses

13 04 2011
TheGODsOPINION

Hi Everyone!

Maybe u can help me in this case:

I have an HTML PAGE with TEXTAREA, DROP-DOWN-LIST and SUBMIT BUTTON
and lets say User typed “TEXT” in the TEXTAREA and CATEGORIZED it with the DROP-DOWN-LIST OPTION called “OPTION1”. After he hit the SUBMIT Button, I would like that his “TEXT” is saved in the
MYSQL TABLE under FIELD “OPTION1”.

Whats the PHP Code for that?

Thank you in advance!

13 04 2011
MsJessie1975

i received an email but it wasn’t HTML, i received the details but the HTML wasn’t rendered and all the tags were showing in the mail, also the return address was not there

14 04 2011
JDOG13596

I FOUND A DREAMWEAVER CS5 CRACK (YOU CAN GET IT 4 FREE)!!!! I LOVE IT

14 04 2011
idiotrun1997

What does EOD mean?

14 04 2011
bossio123

Thanks a LOT for all your tutorials Tutvid! I’ve never build a website before and also didn’t know how to do it.

But because of your videos i managed to build one, awesome!

14 04 2011
bgdeer

need to create a form goto sharepointformwebpart use promo code WDS15 get 15% off

14 04 2011
RKMultiMedia87

@RKMultiMedia87

PS: i am not using xaamp anymore, it was a headache setting up a server locally — talk about leaving that for the computer scientists and developers loool… i did not want to keep wasting time so i signed up for a free hosting site to test my scripts and make my website live. msg me if ur interested, i don’t want to spam & advertise anything here.

14 04 2011
RKMultiMedia87

@WeAreMightyDucks

man same here, my correct is definitely correct… i get the thank you for your interest page after clicking submit and nothin in my inbox neither spam/junk mail.

14 04 2011
AppleJailbreakMan

I have copied it completly and removed the word ‘Field’ and it is STILL not sending the email!!!! Please someone reply to this comment and tell me whats wrong!!! Thankyou. If you do i will subscribe!

14 04 2011
WeAreMightyDucks

@WeAreMightyDucks FOUND THE PROBLEM XD!! it was going into my junk folder ;p

14 04 2011
WeAreMightyDucks

mine just.. doesn’t send 😦 no errors in the code. it redirects me with the correct message.. and i looked over but i still can’t find the reason why it isn’t sending me an email when i submit info from the form

14 04 2011
RKMultiMedia87

@RKMultiMedia87

from my experience, those are the things im aware of and just remembered how to test your PHP locally…. just google xaamp.html and it should take you to a link for both mac and windows users of how to install PHP n the apache server on your computer…. just throwing my little 2 cents. hopefully that helps.. im still testing things out.. good luck guys!

14 04 2011
RKMultiMedia87

for those of you who are PHP testing on your local drive, you 1st need to go to manage your site & go to testing your server & configure it to Server Model: PHP MySQL then Access: LocalNetwork & double check the folder below it needs to be in

also if you want to test locally, PHP needs a server, so you would need to install the APACHE server to test out your PHP code on your local drive since we are unable to test anything remotely (which is what i am doing in the meantime)..

14 04 2011
RKMultiMedia87

@p20barbie

yea im wondering also, i doubled checked to make sure my codes are correct just the way the great nate showed us!!, but not sure if works on local drive as i changed my testing server to my local host and PHP,

when i click send email.. it takes me straight to the PHP file i’ve created ina new tab on my browser.. any clue guys?

14 04 2011
danfong01

I removed “Field” as suggested but my email results were still blank. After mulling over it for hours, it turns out I had POST in lowercase…

14 04 2011
danfong01

@Sharu365 I’m having a similar problem but if you go back in the comments, you’ll see there’s something wrong in the demo, something along the lines of adding/subtracting the word “Field” but I haven’t gotten it to work yet

14 04 2011
p20barbie

its not possible to test without putting the files to the server is it?

14 04 2011
Sharu365

I get the email just not the information i typed in… Help anyone?

14 04 2011
vixpix26

Awesome! Thanks so much!

14 04 2011
ukflipside

Wish I had read the comments……. works a treat but you need to change the variables in the email body from $email to $emailField they should be the same as the gathering data variables ie: $emailField = &_POST[’email’];
However I’m no webdesigner and I wanted to do a form for a friends business website and this worked, best way of doing it but it took a couple of days…….
remember to create a form first then add a table inside the form box when designing the webpage :O)

14 04 2011
TheMrTMonkey

Hey man!

Great tutorial!

Tho I got a problem. When I click on the submit button it downloads the PHP file.
Very weird,

Could you please help me?

14 04 2011
Eliteoomph

@thissitesuxmytwat01
i had the same problem and this is what fixed it for me…
I followed you same instructions…
$emailField = $_POST[’email’] to
$email = $_POST[’email’]
however it still didn’t work BECAUSE my actual id was
“Email” not “email”
Make sure all your ids are in the exact same format as in your form.

hope that helps

14 04 2011
SandThomes

@thissitesuxmytwat01

I am having the same problem… let me know if you figure it out

14 04 2011
jooohne

thanxxxxxxx

14 04 2011
cujaj

Thanks a lot for the great tutorial//

manchestermod > yeah dude, i’ve changed it and it worked for me too –
the word Field should be removed..
however the email being send doesn’t render a valid “from” address // and my email puts it into a spam box..

i’ve tried to add this // ‘From: ‘.$emailadd.” inside the mail() however it doesn’t worked

$success = mail($webMaster, $emailSubject, $body, $headers, ‘From: ‘.$emailadd.”);

any ideas ?




%d bloggers like this: