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.
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.
Last edited by danny_matthews; 03-22-2009 at 09:11 AM.
No one has any ideas? I think its something to do with the php script?!
Please? anyone!
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:
Simple as that really,PHP Code:<?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);
?>
Good luck.
Last edited by Schmoopy; 03-20-2009 at 04:28 PM.
danny_matthews (03-20-2009)
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.
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
Bookmarks