gatekeeper Posted September 6, 2005 Share Posted September 6, 2005 I am not an advanced user of PHP/MYSQL but I have gotten by on my pages using Dreamweaver. Currently I use the web-based PHP from my ISP and I would like to configure it so that when someone enters in data - it not only goes to my database, but copies me in email. Can someone give me an idea of how this might work? Thanks ahead of time for your help Ryan http://www.godsandnemesis.com Quote Link to comment https://forums.phpfreaks.com/topic/2486-copying-results-to-email-address/ Share on other sites More sharing options...
dunkleybrown Posted September 23, 2005 Share Posted September 23, 2005 The following code works for me (everything between dotted lines). The basic function is the mail function, and i have 4 variables that it takes, the $toaddress gets assigned your email address. $subject is what the subject header will be. $mailcontent is what will be in the body (the trickiest part) and $fromaddress is what will appear as the sender (you can leave this out if you want). ------------------------------------------------------------------------ // create variables from form $firstname = $_POST[Firstname]; $lastname = $_POST[Lastname]; $date = $_POST[Date]; $request = $_POST[Request]; $email = $_POST; // send email $toaddress = 'you@yourdomain.com'; $subject = 'Email Subject Line Here'; $mailcontent = $firstname.' '.$lastname"\n"$date"\n"$request; $fromaddress = 'From: '.$email; mail($toaddress, $subject, $mailcontent, $fromaddress); ------------------------------------------------------------------------- This might look complicated, email me if it's unclear: dunkley@dunkleybrown.com Quote Link to comment https://forums.phpfreaks.com/topic/2486-copying-results-to-email-address/#findComment-8497 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.