background preloader

PHPMailer tutorial for SMTP and GMail

PHPMailer tutorial for SMTP and GMail
These days I tried some plugin to send e-mail message within WordPress via SMTP. Since my domains email is hosted with Google applications I decided to send my messages via the SMTP server from GMail. I found several articles and PHPMailer tutorials, but a lot of them didn’t worked for me. Why using GMail for sending mail messages? First of all it’s FREE! Requirements You need for this PHPMailer code example a PHP5 enabled web host (I did tests only on Linux), the port 465 need to be open and of course you need a GMail or Google Apps account. Trouble sending e-mails with your “normal” GMail account? PHPMailer tutorial for GMail and Google Apps Hosting for developers - Free Trial! Advanced setup with fall-back SMTP server Because of the e-mail message limit it might be useful to use a secondary SMTP server if the GMail option is unable to send the message. Next we need to create an if/else statement using the variables for the second server (replace). UPDATE: Alternate SMTP service

Send Email from localhost/WAMP Server using PHPMailer/SMTP | TechWheels.net's Technology Blog When building professional web applications, it is very necessary to test email functionality before deploying the website. It is therefore a requirement for web developers to send emails from their development machine during development process. This solution is useful not only for localhost/WAMP server but also for sending bulk emails from online website. The PHP’s mail() function every time opens and closes sockets to the email server and thus email sending becomes slower. Solution After tweaking with the Apache and PHP’s INIs, I succeeded in sending email from my WAMP server. So, to use PHPMailer with Gmail, ensure the following: IMAP Access is enabled in your Gmail’s Settings -> Forwarding and POP/IMAP -> IMAP Access: “ssl_module” module in Apache server is enabled: “php_openssl”, “php_smtp” and “php_sockets” extensions for PHP compiler are enabled: From PHPMailer’s .zip file, extract “class.phpmailer.php” and “class.smtp.php” files to “C:\wamp\www\” folder. Update (2-Dec-2012)

Online membership management software We will learn here how to store encrypted password in the table. Before this in our basic Member signup & login script we have used varchar field to store the passwords of the users. For better security of our software we will encrypted the password by using MD5 encryption and then store the hash of the password string in the table. With this modification managing the script became little different as we can't retrieve the lost password. With the popularity of Ajax , we have included this concept in our membership management script new versions. Length of the password field to store MD5 encrypted password In the present membership management software we have increase the filed size to 32. Signup page While inserting the member details to our member table we have to encrypt the password of the member before storing them in the table. While checking the signup details of the member we have to check the email address used by the member is already there with us or not. Login page

Related: