Page 1 of 1

Send form data to MySQL and to email

Posted: Thu Feb 04, 2010 5:12 pm
by jackponte
Hi,
I'm very new to PHP and MySQL but I was thrown into this project. I was able to figure most of it out and I'm able to pass all object from the HTML form to arrays in PHP and then send them to the MySQL DB. They now ask me they want the info in the DB but also they want the same info emailed. What is the best way to go about that:

- From the form email abnd then add to DB
- From the form Add to DB and then email confirmation with the info

The second seems to most logic as I already have everything going from the form to the DB. However, I do not have an SMTP server running in the server so I do not know how to send the email. I have the script FormToEmail.php but I do not know if it can be used.

Thanks for your help.

Jack P

Re: Send form data to MySQL and to email

Posted: Thu Feb 04, 2010 6:36 pm
by manohoo
Jack, that's a difficult task for a novice like you. The second option makes more sense, since you ONLY want to email success after success happens, you got that one right.

Now to the difficult part, emailing. It can be tricky if you code it yourself, so I suggest that you spend a little time learning about PHPmailer as it might be one easy alternative. Google it, you will find a lot of help out there.