View Full Version : Resolved Automated Email response?
danny_matthews
03-19-2009, 08:04 PM
Hi again, hope all is well.
Im trying to find a way for an automated email to be sent to the user after they have completed and submited a form upon my website.
Any ideas as to how i tackle this one?
Thanks, Danny.
danny_matthews
03-20-2009, 03:19 PM
No one has any ideas? I think its something to do with the php script?!
Please? anyone!
Schmoopy
03-20-2009, 03:28 PM
After you've done whatever needs doing, like adding their details to the database, just use the mail function. I imagine you take their email so I'll use $_POST['email'] for that.
More on the mail function (http://uk.php.net/manual/en/function.mail.php):
<?php
// Add to the database here, if successful execute the following
// You'll want to do some sort of validation on the email before sending it to avoid sending hundreds of emails that lead nowhere
$to = $_POST['email']; // To the user
$subject = 'Thanks for visiting my site'; // Subject of the message...
$message = 'Hello, ' . $_POST['email'] . "\n Thanks for visiting my site etc..."; // Contents of the email
$headers = 'From: yourwebsite@website.com' . "\r\n" .
'Reply-To: yourwebsite@website.com' . "\r\n";
mail($to, $subject, $message, $headers);
?>
Simple as that really,
Good luck.
danny_matthews
03-21-2009, 12:13 AM
Thank you! I had thought it was something fairly simple, just couldn't quite get there myself. So thank you, it is really appreciated.
Danny.
AlanJ
04-17-2009, 12:18 AM
If you want to send a series of e-mails, you might also consider using an auto responder such as aweber.
Just a thought.
Alan
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.