Dear Friends,
As usually I came with a PHP Problem.
I've created a form. When user press the Submit button all the data will added to the database.
I want to send an email with all data in form to my inbox when the user pressed a submit button.

Summary is I wants to add dual action when user press submit button.
1. Add data to the Database
2. Send an email to my inbox

Need your help.
Thanks

Recommended Answers

All 4 Replies

hai Shalomd,

have you tried anything/any code so far please share with us?

for sending mail use php mail(to,subject,message,headers,parameters) function like as in the given url

http://www.w3schools.com/php/func_mail_mail.asp

let me know the status

happy coding

When you say;

I've created a form

Where is the form?

**Use:Example:**
<?php
if(isset($_POST['submit']))
{
     $SQL = "INSERT INTO tablename(ID, Name, Price) VALUES ('', '4-6 Days', '£75.00')";
     $result = mysql_query($SQL);
}
?>
And use mail(to,subject,message,headers,parameters) function to send the email.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.