How can I send an automated e-mail to a users entered e-mail address?
I have Xampp, which is a local web server equipped with Apache, and Mercury for mail.
Ideas?
How can I send an automated e-mail to a users entered e-mail address?
I have Xampp, which is a local web server equipped with Apache, and Mercury for mail.
Ideas?
To send email: Look up the mail function.
To schedule a task in linux look up crontab.
To schedule a task in Windows look up task scheduling in the control panel.
And don't use Xampp for production. It's insecure.
This is not an answer to your question, but could be relevant anyway:
My experience with a local web-server is that the mail will not get to its destination. It depends on your isp, but if you have a changing ip address every time you connect to your isp (dial-up, adsl, cable), your outgoing mail will most likely be rejected by the recipients mail server.
A lot of those ip ranges that isp give their clients are blocked by spam filters.
At least the range I am in is :)
Instead of php's mail() function you should use something like http://swiftmailer.org
You can easily do smtp-authentication, encryption, mime-mail, character encoding, batch mailing ...
And you get much more reliable error reporting.
You can use phpmailer to send mail via SMTP protocol , this library is pretty good ! ( Wordpress CMS use it ! )
php.net/mail:
Be careful though, because bad people will write scripts to submit your form with a zillion email addresses and try to send spam. They will also (try) to embed \r\n in the submitted address to write out other content and headers. I do something like this:
then I run user inputted strings through sanitize() before calling mail(). YMMV of course.