Web & Apps

How to Configure a Gmail Account to Send Emails Through a System

Gmail configuration

1. Introduction

Many software systems need to send emails automatically. Examples include:

·        User registration and account verification emails.

·        Password reset notifications.

·        Payment confirmations and receipts.

·        System alerts and notifications.

·        Employee communications.

·        Reports and other automated messages.

Instead of building and maintaining your own mail server, you can configure a Gmail account to act as the outgoing email service for your system.

Gmail supports SMTP (Simple Mail Transfer Protocol), which allows external applications to authenticate with Google and send emails through Google's mail servers.

This guide explains how to configure Gmail, generate the required credentials, and connect the account to a software system.

2. Requirements

Before starting, ensure you have:

1.     An active Gmail account (e.g. yourcompany@gmail.com).

2.     Access to the Google account.

3.     A system or application that supports SMTP configuration.

4.     An internet connection.

5.     Access to the system's email or SMTP settings.

Important: You should not use your normal Gmail password directly in your application. Google requires an appropriate authentication method, such as an App Password or OAuth 2.0.

3. Step One: Prepare the Gmail Account

First, log in to the Gmail account you intend to use for sending system emails.

For example:

notifications.yourcompany@gmail.com

It is advisable to create a dedicated account for system notifications rather than using an employee's personal email account.

This makes it easier to manage system communications, monitor outgoing messages, and maintain access when employees change roles.

4. Step Two: Enable Two-Step Verification

Google requires Two-Step Verification before an App Password can be generated.

Follow these steps:

1.     Visit Google Account Security.

2.     Sign in using the Gmail account you intend to configure.

3.     Locate the section labelled how you sign in to Google.

4.     Select 2-Step Verification.

5.     Follow Google's instructions to enable it.

6.     Complete the verification process.

Once enabled, your account will have an additional security layer.

5. Step Three: Generate a Gmail App Password

An App Password is a special 16-character password generated by Google. It allows compatible applications to access your Gmail account without using your normal Google account password.

Follow these steps:

1.     Visit Google App Passwords.

2.     Sign in if prompted.

3.     Enter an application name, for example, Company ERP System.

4.     Click Create.

5.     Google will generate a 16-character password.

6.     Copy the generated password and store it securely.

Important security considerations:

·        Do not share the App Password with unauthorized persons.

·        Do not place it directly in publicly accessible source code.

·        Store it in environment variables or secure application configuration.

·        If the password is compromised, revoke it and generate another one.

Note: App Passwords may not be available for some accounts, including accounts using certain security configurations or Google Workspace administrator restrictions.

6. Step Four: Configure Gmail SMTP Settings

Once you have generated the App Password, you can configure your system to communicate with Gmail's SMTP server.

Use the following settings:


 Configuration
 Value
 SMTP Server | smtp.gmail.com
 SMTP Port | 587
 Encryption | STARTTLS / TLS
 Authentication | Enabled
 Username | Full Gmail address
 Password | Generated App Password
 From Email | Your Gmail address
 From Name | Your Organization/System Name

Alternatively, you can use port 465 with SSL encryption.

For most applications, port 587 with STARTTLS is a suitable configuration.

7. Step Five: Enter the Settings Into Your System

Log in to your system's administration panel and locate the email configuration settings.

Depending on the software, this section may be labelled:

·        Email Settings

·        SMTP Configuration

·        Mail Server Settings

·        Notification Settings

·        System Email Configuration

Enter the SMTP details from Step Four.

Sample SMTP configuration:


 Field
 Sample Value
 SMTP Host | smtp.gmail.com
 SMTP Port | 587
 Encryption | STARTTLS
 SMTP Username | notifications.yourcompany@gmail.com
 SMTP Password | Your 16-character App Password
 Sender Name | Your Organization
 Sender Email | notifications.yourcompany@gmail.com

Replace the sample email and password with your actual credentials.

Save the configuration.

8. Step Six: Test the Email Configuration

After saving the SMTP settings, look for an option such as Send Test Email, Test SMTP Connection, or Send Test Message.

Follow these steps:

1.     Enter an email address you can access.

2.     Initiate the test.

3.     Wait for the system to process the request.

4.     Check the recipient's inbox.

5.     Check the spam or junk folder if the message is not visible.

6.     Confirm that the sender name and email address are correct.

If the test email arrives successfully, your system is communicating with Gmail's SMTP server.

9. Step Seven: Test Automated System Notifications

A successful SMTP connection does not necessarily mean every system notification is configured correctly.

Test the actual functions that should generate emails, such as:

·        User registration.

·        Password reset.

·        Account activation.

·        Payment notifications.

·        Transaction receipts.

·        Administrative notifications.

Confirm that each email is delivered with the correct subject, message content, sender details, and recipient address.

10. Troubleshooting Common Problems


 Problem
 Possible Solution
 Authentication failed | Confirm that you are using the App Password, not the normal Gmail password.
 Could not connect to SMTP server | Check internet connectivity, SMTP host and firewall restrictions.
 Connection timed out | Confirm that outbound port 587 or 465 is not blocked by your hosting provider.
 Emails go to spam | Review email content, sender reputation and authentication requirements.
 App Password unavailable | Check that 2-Step Verification is enabled and that Workspace policies permit App Passwords.
 Emails are not being sent | Check the application's mail logs and SMTP error messages.
 Daily sending limit reached | Review Gmail's sending limits and consider a dedicated email delivery service.

11. Important Considerations When Using Gmail for System Emails

Although Gmail is convenient for smaller systems, there are some limitations to consider.

A. Sending limits

Gmail imposes daily sending limits. These vary depending on the account type. Systems sending large volumes of automated messages may exceed these limits.

B. Account security

Anyone with access to the App Password may be able to use the account for SMTP authentication. Restrict access to the credentials.

C. Email deliverability

Using Gmail SMTP does not guarantee that every message will reach the recipient's inbox. Spam filtering, recipient policies and sender reputation still apply.

D. System availability

If Google restricts the account, the password is revoked, or the service is temporarily unavailable, your system may fail to send notifications.

E. Business email identity

For organizations that want to send messages from an official company domain, Google Workspace or a dedicated email delivery service may be more appropriate.

12. Gmail SMTP Sending Limits

This is one of the most important considerations when configuring Gmail for automated system emails, and it is often overlooked until the account reaches its sending limit.

Gmail imposes daily sending restrictions to prevent spam and abuse. These restrictions apply to the number of recipients, not simply the number of messages sent.

A free Gmail account generally allows sending to up to 500 recipients per day, while a paid Google Workspace account generally supports up to 2,000 recipients per day, subject to Google's policies and account eligibility.

Understanding recipient-based limits

The sending quota is recipient-based. This means that sending one email to 20 different recipients counts as 20 recipients towards your daily sending limit.

For example:

·        Sending 1 email to 1 person = 1 recipient.

·        Sending 1 email to 20 people = 20 recipients.

·        Sending 100 individual emails to different people = 100 recipients.

Gmail sending limits breakdown


 Account Type
 Daily Recipient Limit (Web)
 SMTP-Specific Limit
 Free Gmail (@gmail.com) | 500 recipients/day | Approximately 100 emails/day as a conservative planning estimate
 Google Workspace (Paid) | Up to 2,000 recipients/day | Up to 2,000 recipients/day, subject to applicable restrictions

Note: The approximately 100 emails/day figure for free Gmail is a practical planning estimate, not a separately guaranteed Google-published SMTP quota. Actual limits vary depending on account type, sending method and Google's enforcement policies.

What happens when you exceed the limit?

When your Gmail account exceeds its sending allowance:

1.     Gmail may temporarily prevent the account from sending additional emails.

2.     Your software system may return SMTP authentication or sending errors, or report that the message could not be delivered.

3.     Automated notifications, password resets, receipts and other system-generated emails may fail.

4.     You may need to wait for the sending restriction to reset before normal email sending resumes.

Recommendation

For small applications with limited email traffic, a free Gmail account may be sufficient.

However, for business applications, ERP systems, CRMs, e-commerce platforms and other systems that send frequent automated notifications, a Google Workspace account or dedicated transactional email service is recommended.

This helps reduce the risk of email interruptions when the system experiences increased usage.

Important: Do not design a business-critical application around the assumption that Gmail will always accept unlimited automated messages. Implement email queues, retry mechanisms, delivery logging and failure notifications so that unsuccessful messages can be investigated and resent.

13. Recommended Configuration for Production Systems

For systems that handle business-critical communications, consider OAuth 2.0 authentication or a dedicated transactional email provider rather than relying solely on Gmail App Passwords.

OAuth 2.0 avoids storing a reusable Google account password in the application, although it requires additional integration and token management.

For high-volume applications, dedicated email services are generally better suited to automated delivery, monitoring and email reputation management.

For organisations using Google Workspace, SMTP Relay (smtp-relay.gmail.com) is another option for applications and devices that need to send email through Google's infrastructure. It requires appropriate administrator configuration.

14. Conclusion

Configuring Gmail SMTP is a relatively straightforward way to enable a software system to send automated emails.

The essential process involves:

1.     Preparing a dedicated Gmail account.

2.     Enabling Two-Step Verification.

3.     Generating an App Password.

4.     Entering Gmail SMTP settings into the system.

5.     Testing the connection.

6.     Verifying automated notifications.

7.     Monitoring email sending limits and delivery failures.

Once configured correctly, your application can use Gmail to send automated messages without requiring users to manually compose emails.

15. Official Google Documentation

For additional information and reference, consult Google's official documentation:

1.     Gmail SMTP Configuration – SMTP server addresses, ports and authentication.

2.     Google App Passwords – Creating and managing App Passwords.

3.     Send Emails From an Application Using Google Workspace – Alternative email delivery configurations.

4.     Google Workspace Gmail Sending Limits – Email sending quotas and restrictions.

 

Need help with this for your business?

Talk to our team on WhatsApp +256 754 678 625 or email office@razertechnology.com.

Book a consultation

Meet us online (your first online consultation is free) or at one of our offices.

  1. 1Consultation
  2. 2Date & time
  3. 3Your details
  4. 4Confirm
How would you like to meet?
Google Meet, Zoom or WhatsApp video · 30 minutes Free first consultation
Have you had an online consultation with us before?

What would you like to discuss?

Get a quote