How to send email with Gmail (mail module)

From TomatoCMS Documentation

Jump to: navigation, search

TomatoCMS 2.0.6 has new mail module which allows you to send mail by using PHP's mail() function or SMTP server. Because Gmail is the most popular mail system used by users/developers, the following guide show how to use Gmail with mail module.

Environment

PHP 5.2.10 on Windows


Step 1: Install openSSL extension for your PHP

- Open your php.ini files, search for extension=php_openssl.dll and remove the ; character at the beginning of this line if there is:

    extension=php_openssl.dll


- Restart Apache server and if you see the openssl from the list of installed extensions, congratulation!

File: phpinfoOpenssl.png

If not, please copy two files, libeay32.dll and ssleay32.dll from your PHP installed directory to the Windows system directory (C:\Windows\System32), and restart Apache server.


Step 2: Configure the mail module

Now, you can login to the TomatoCMS's back-end, click on Config mail server link in the Dashboard, and make settings as follow image

File: configEmail.png

(Of course, you have to change the value of Username and Password text boxes)

The alternative way is open /application/modules/mail/config/config.ini file and put the following content to this file:

    [protocol]
    protocol = "smtp"
 
    [smtp]
    host = "smtp.gmail.com"
    port = "465"
    security = "ssl"
    username = "YourEmail@gmail.com"
    password = "YourPassword"


Now, you can try to send emails from mail module with your Gmail account.

Personal tools