It is a good alternative compared to the PHP mail function.
You can use this type of SMTP service to receive customer inquiries through the
contact form of your application, password reset emails, order confirmation,
etc. However, this has a limit to send emails, that is, 500 emails per day or
500 recipients in a single email per day.
Therefore, if you want to send transactional and marketing
emails (in volumes), we recommend that you set up a third-party email delivery
service, such as the Elastic Email (paid) add-on.
Step 1: allow access to Google account
Before using Gmail SMTP, you must authorize your server to
access your Google account.
Click here, log in to your Gmail account, then click
Continue.
Note: You must use your main Google account to achieve this
purpose. If you have merged google accounts, you will receive an authentication
error.
This will enable access to your account for your new device
(web server).
Step 2: Generate the application password if two-step
verification is enabled
If you have enabled two-step verification in your Google
account, you must generate an application-specific password. If you are not
using two-step verification, you can skip this step and go to Step 3.
Select Other / Custom Name in Select Application, name it as
"DO - Production Server" and then click Generate.
Write down the application password, as it will be necessary
in the next step.
Now, open the link again and click Continue.
Step 3: Configure Gmail in the SMTP plug-in
Enter the details of Gmail inside the SMTP plug-in (to
activate the SMTP plug-in).
1. Select Other / Custom SMTP from the drop-down menu
2. Enter smtp.gmail.com as your host
3. Use port 587
4. Enter your Gmail login username your.username@gmail.com
5. Enter your Gmail password OR application password (if
two-step verification is enabled)
Click Save to finish the configuration on the server.
That's. Your Gmail email service has been configured on your
server for outgoing transactional emails.
Step 4: test the SMTP functionality
Once the settings are updated, you can test them by sending
mail through SSH.
Once you are logged in through ssh, use the following command
to send mail for testing:
1 email -s "subject" email@domain.com
Type your content and press enter
Use ctrl + d to send the mail.
You can find out if it is successful or not by checking if
you received the email. If the email is not delivered, you can use the mailq
command to check for errors.
If the mail queue is empty, the mail is sent successfully
from your server.
No comments:
Post a Comment