The concept was clearly simple. Every 01.00 AM, there is a script executed by a crond daemon (crontab) on the web server which running a search & querying thousands of members which having birthday on the current date. If they are exist, one by one member are sent the email script generated by the add in custom made module integrated to the website.
0 1 * * * /usr/bin/php –f /var/www/html/your_script.php
On a web server running an SMTP server integrated to the same machine, there will be no problem at all. But, what about if they had separated on each different machine & location? Well, actually the systems are also the same. The thing you have to ware is the availability of the incoming connection by the mail server from external IP address especially from the web server. For this, you can setting up the mail server option.
Look at the sample script below how to create this similar automated email notice:
IsSMTP(); // telling the class to use SMTP
$mail->Host = "your.smtp.host "; // SMTP server
$mail->From = "email@example.com";
$mail->FromName = "Your Name Here";
$mail->Subject = $subject;
$mail->Body = $pesan;
$mail->WordWrap = 50;
echo("Server email down. [" . $mail->ErrorInfo . "]");
echo("[$hr_ini] >> Permintaan account telah dikirim ke alamat $email.\n\n");
It is not so difficult to setting up it with PHPMailer, like to I used always before.
Labels: My Share
PS: If you've benefit from this blog,
you can support it by making a small contribution.