Send form data to MySQL and to email

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jackponte
Forum Newbie
Posts: 11
Joined: Thu Feb 04, 2010 5:04 pm

Send form data to MySQL and to email

Post 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
User avatar
manohoo
Forum Contributor
Posts: 201
Joined: Wed Dec 23, 2009 12:28 pm

Re: Send form data to MySQL and to email

Post 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.
Post Reply