Mail Server Set up in AEM using GMail

Applicable for versions AEM 6.x

AEM provides OOTB OSGI configuration to enable the mailing service.This service is named as DAY CQ Mailing service. Here the configuration of the SMTP server to be used needs to be added. In this blog, we are going to see how can we use gmail SMTP server to enable the mailing service in AEM.

Following are the steps :

SMTP Server Host Namesmtp.gmail.com
SMTP Server Port465
SMTP User<gmail address>
SMTP Password<gmail password>
“From” address<gmail address>
SMTP use SSLCheck this
SMTP use StartTLSDon’t check
Debug emailDon’t check

Search for the config file using PID. Check in this config file into configuration code base to persist the configuration even after deployment. [com.day.cq.mailer.DefaultMailService.config]

# Configuration created by Apache Sling JCR Installer
smtp.password="secretPassword"
debug.email=B"false"
smtp.port=I"465"
smtp.user="adobeexplorers@gmail.com"
smtp.ssl=B"true"
smtp.starttls=B"false"
from.address="adobe-explorers@gmail.com"
smtp.host="smtp.gmail.com"

The mail server integration is completed and Day CQ Mail service is active now. You can send emails from AEM instance.