DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk11 min

How to Send Mail From Sendmail Through a Gmail SMTP Server

A complete Sendmail-to-Gmail SMTP guide covering smart-host configuration, ports 587 and 465, app passwords, OAuth, authinfo maps, CA verification, logging, limits, and Workspace SMTP relay.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure Sendmail as a smart-host client of smtp.gmail.com. Use port 587 with STARTTLS (the usual choice) or port 465 with implicit SSL/TLS. Gmail requires SMTP authentication: use the complete Gmail or Google Workspace address with a dedicated app password when the account supports app passwords, or use OAuth 2.0 through a Sendmail integration that supports XOAUTH2 or OAUTHBEARER. For organization-wide devices and applications, Google recommends its separate SMTP relay service rather than a single mailbox relay.

The practical sequence is: prepare the Google account, select the TLS port, set Sendmail’s SMART_HOST, add a protected authinfo map entry whose key exactly matches smtp.gmail.com, configure CA trust for certificate verification, rebuild the Sendmail configuration, reload the service, and inspect the mail log while sending a controlled test.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need before editing Sendmail

Have administrative access to the Sendmail host, the platform’s .mc source file, the account that will authenticate to Gmail, and the location of the host’s trusted CA bundle. You also need outbound DNS and TCP access to the selected Gmail port. The exact paths, service names, ownership rules, and configuration-build commands differ among Linux and Unix distributions, so use the Sendmail files and service tooling supplied by your operating system rather than copying a distribution-specific command blindly.

  • A Gmail or Google Workspace mailbox permitted to authenticate through SMTP.
  • Two-Step Verification and a dedicated app password if you are using Google’s app-password method.
  • OAuth 2.0 credentials and a Sendmail SASL mechanism that supports XOAUTH2 or OAUTHBEARER if you are using OAuth instead.
  • Sendmail built with TLS support, plus a current CA file or hashed CA directory.
  • Permission to protect the authentication map and generated Sendmail configuration from other users.

Google documents the Gmail SMTP service, authentication requirements, and protocol choices in its Workspace SMTP guidance and Gmail IMAP and SMTP documentation.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Choose direct Gmail SMTP or Workspace SMTP relay

Direct Gmail SMTP is appropriate when one mailbox should send authenticated mail for a host or a small, clearly bounded deployment. The credentials identify that mailbox, and Gmail applies the account’s security, sending, and anti-abuse policies. Google lists a 2,000-message-per-day limit for the Gmail SMTP server; treat that as a documented service limit, not as a promise that every account can safely send at that rate.

For printers, monitoring systems, application servers, and other organization-wide devices, Google recommends the SMTP relay service. Its fully qualified host is smtp-relay.gmail.com, and Google documents ports 25, 465, and 587 for that service. Relay rules can be managed for an organization instead of embedding one user’s mailbox password on every device.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision factor Direct Gmail SMTP Google Workspace SMTP relay
Relay host smtp.gmail.com smtp-relay.gmail.com
Typical scope One mailbox or a small authenticated deployment Organization devices and applications
Authentication model Account credentials with an app password, or supported OAuth 2.0 Workspace relay policy; Google documents organization-level options such as IP-based authorization
Documented ports 465 for SSL; 587 for TLS 25, 465, and 587
Operational ownership Mailbox security, app-password rotation, and account policy Workspace administrator’s relay rules and organization controls
Best fit A Sendmail host acting for a specific account Many devices or applications that should not share a mailbox secret

The rest of this guide covers direct smtp.gmail.com delivery. Move to the Workspace relay section when the deployment is larger, device-oriented, or likely to approach Gmail’s account-level limits.

Prepare the Google account securely

Use an app password when that method is available

Turn on 2-Step Verification for the Google account, then create an app password dedicated to this Sendmail host. Give the credential a name that identifies the server and purpose so it can be revoked without affecting interactive sign-in. Store the generated value as a secret; do not put a normal account password in a world-readable file, a public repository, or the article’s configuration examples.

The Sendmail login is the complete address, such as [email protected], not merely the local part before the at-sign. Enter the generated app password in the protected authentication map. If an administrator later revokes the app password, Sendmail will begin returning authentication failures until a replacement is created and the map is rebuilt.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Use OAuth 2.0 where the integration supports it

Gmail protocols support OAuth 2.0. A Sendmail deployment must have a SASL path that can obtain and refresh tokens and use the mechanism expected by Gmail, commonly XOAUTH2 or OAUTHBEARER. OAuth is the standards-based alternative when app passwords are unavailable or prohibited by account policy, but it is not a drop-in substitution for a password string: token acquisition, storage, refresh, and scope approval all have to be implemented by the selected Sendmail integration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not configure a normal Google account password as a workaround. A rejected password can indicate that the account requires an app password, that the app password was revoked or mistyped, or that the deployment’s OAuth mechanism does not match the account flow.

Pick the Gmail transport and port

Port Security model Sendmail behavior When to choose it
587 STARTTLS Connect in SMTP, issue STARTTLS, validate the certificate, then authenticate Default choice when the Sendmail TLS build and CA trust are available
465 Implicit SSL/TLS Negotiate TLS before SMTP commands are exchanged Use when the Sendmail integration is designed for implicit TLS and your network permits the port

Google maps port 465 to SSL and port 587 to TLS in its current protocol guidance. Do not treat the two ports as interchangeable settings: STARTTLS requires Sendmail to issue and complete the protocol upgrade, while port 465 requires TLS from the first connection bytes.

Whichever port you select, certificate verification and authentication still matter. Encryption without peer verification can leave a client vulnerable to an impersonated endpoint, and authentication without an encrypted channel can expose credentials.

Set Sendmail’s smart host

Edit the platform’s m4 source

In the Sendmail .mc source used by your operating system, define Gmail as the smart host:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
define(`SMART_HOST', `smtp.gmail.com')dnl

SMART_HOST tells Sendmail to route outbound mail through the named relay rather than attempting direct delivery to each recipient domain. The definition belongs in the source file that generates sendmail.cf; editing the generated file directly is likely to be lost at the next rebuild.

Account for the selected port

The smart-host definition identifies the relay; your installed Sendmail configuration must also express whether the connection uses STARTTLS on 587 or implicit TLS on 465. The exact m4 options and feature names vary by Sendmail release and distribution. Read the local Sendmail cf documentation for the TLS and relay syntax supported by that installation, and verify that the resulting configuration points to the same hostname used by the authentication map.

A mismatch such as configuring smtp.gmail.com as SMART_HOST while keying authentication for a different alias can produce a relay-denied or unauthenticated result even when the account credentials are valid.

Add SMTP AUTH with Sendmail authinfo

Enable the authinfo feature

Sendmail’s authinfo feature supplies SMTP AUTH data to the relay. A generic m4 pattern is:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
FEATURE(`authinfo', `hash -o /etc/mail/authinfo.db')dnl

The file name, map type, directory, and build command are distribution-specific. Use the map format documented in the Sendmail cf/README shipped with your version, and make the source and database readable only by the account and group that require them.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Match the relay hostname exactly

The authinfo map key must match the relay hostname that Sendmail uses. For direct Gmail SMTP, that key is smtp.gmail.com. A generic entry pattern, shown with a non-functional account and secret, is:

AuthInfo:smtp.gmail.com "U:[email protected]" "P:APP_PASSWORD" "M:PLAIN"

Use the full Gmail or Workspace address after U: and the generated app password after P:, or use the OAuth mechanism supported by your deployment. The example is a pattern, not a credential: never publish a real secret, commit one to source control, or leave the plaintext source file broadly readable.

Sendmail warns against using plaintext mechanisms such as PLAIN or LOGIN unless a strong encryption layer, such as STARTTLS or an external SSL tunnel, is active. Therefore, do not enable PLAIN or LOGIN on an unencrypted connection. With port 587, ensure STARTTLS has completed and the certificate has been verified before SMTP AUTH is attempted.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build and protect the map

Generate the authentication database using the map-building procedure supplied by your operating system, then set ownership and permissions appropriate for Sendmail. Protect both the source map and the generated database; a database that is secure while its source file remains world-readable still exposes the credential. If you rotate an app password, update the source, rebuild the map, and reload Sendmail so new deliveries use the replacement.

Configure CA trust and TLS verification

STARTTLS is not complete merely because the server advertises it. Sendmail needs a TLS-capable build and a trusted CA bundle to authenticate Gmail’s certificate. Configure the appropriate CA file and/or hashed CA directory through the Sendmail TLS settings, commonly confCACERT and confCACERT_PATH.

Install the CA bundle maintained by your operating system, then point the m4 configuration at the actual file or directory on that host. Check path spelling, readability by the Sendmail process, and the directory’s hash layout when a hashed directory is used. A missing bundle, an incorrect path, or an outdated trust store can produce a certificate error before Gmail ever evaluates the account credentials.

Do not solve a certificate failure by disabling verification. First confirm that Sendmail was built with STARTTLS support, that the selected port matches the TLS mode, and that the configured CA location contains the issuer chain needed to validate the peer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Rebuild, reload, and perform a controlled test

  1. Save the edited .mc source and the protected authinfo source. Check that the smart-host value and authinfo key both read smtp.gmail.com.
  2. Regenerate sendmail.cf with the operating system’s supported m4/build process. Do not assume a path or command from another distribution.
  3. Rebuild the authinfo database if the source changed, then verify ownership and restrictive permissions on the source, database, and generated configuration.
  4. Reload or restart the Sendmail service using the service manager provided by your platform.
  5. Send one controlled message to an address you can inspect. Avoid beginning with a bulk job; a single test makes the first failure easier to classify.
  6. Immediately inspect the mail log. Look for DNS resolution, TCP connection, STARTTLS negotiation, certificate verification, SMTP AUTH response, Gmail policy response, and any quota or throttling code.

A successful transaction should show a connection to the selected Gmail endpoint, a completed TLS negotiation for the encrypted mode, accepted SMTP AUTH, and a queued or delivered message. The exact log wording depends on the Sendmail release and platform logging configuration.

Diagnose common failures

Symptom Likely cause What to check and correct
Authentication rejected Normal account password, invalid or revoked app password, 2-Step Verification or app-password policy, or an OAuth mechanism mismatch Confirm the complete account address, create a fresh dedicated app password when allowed, or validate the OAuth token and SASL flow. Rebuild the authinfo map after any change.
STARTTLS or certificate error Missing CA bundle, incorrect confCACERT or confCACERT_PATH, unreadable trust store, or a Sendmail build without the required TLS support Verify the TLS-capable build, the selected port’s TLS mode, the CA path, file permissions, and the host’s current CA bundle. Keep certificate verification enabled.
Relay denied or unauthenticated relay The authinfo key does not exactly match smtp.gmail.com, the smart host differs from the map key, or the relay policy does not permit the request Compare the generated configuration and map entry character for character, including the hostname, then rebuild and reload.
Connection timeout Outbound firewall policy, blocked SMTP port, DNS failure, or a routing problem Check DNS resolution for smtp.gmail.com and test outbound TCP access to the selected port from the Sendmail host. If the network blocks one port, use the other only if its TLS mode is correctly supported.
Messages throttled or rejected after initial success Gmail quota, spam or policy filtering, account security enforcement, or an organization rule Review the log and account notices, keep volume within Google’s documented limits, and consider Workspace SMTP relay for device and application traffic.
TLS succeeds but credentials are exposed in configuration World-readable authinfo source or database, backups containing the secret, or a secret committed to source control Restrict ownership and permissions, remove exposed copies, rotate the app password, and treat the old credential as compromised.

Understand limits and operational trade-offs

Direct Gmail SMTP ties Sendmail’s ability to deliver to the health and policy of one Google account. A password rotation, app-password revocation, 2-Step Verification policy change, suspicious-login challenge, or account suspension can stop all mail using that identity. Keep the mailbox ownership clear, document who can revoke or replace the credential, and monitor the Sendmail log for authentication failures rather than discovering the outage from an application queue.

The Google-listed 2,000-message-per-day Gmail SMTP limit is especially important for alerts, scheduled reports, and automated workflows. It is a service limit associated with Gmail SMTP guidance, not a target to plan around without considering recipient behavior, spam controls, and other account policies. If multiple hosts send through one mailbox, their combined activity affects that account’s operational headroom.

Workspace SMTP relay changes the administrative model. Instead of placing one mailbox credential on each device, an administrator defines which systems may relay and how they authenticate. Google identifies this service as the recommended option for devices and apps and documents smtp-relay.gmail.com with ports 25, 465, and 587. It is generally the better fit for printers, monitoring fleets, line-of-business applications, and other organization-managed senders.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Moving to Workspace SMTP relay

  1. In the Google Workspace administration environment, create or review the SMTP relay rule for the organization’s sending systems.
  2. Choose the rule’s authentication and source restrictions according to the network design and security policy; do not assume that a rule for one host authorizes every device.
  3. Change Sendmail’s smart host from smtp.gmail.com to smtp-relay.gmail.com.
  4. Select one of the relay service’s documented ports and configure its corresponding TLS mode. Port 25, when allowed by the network, is not the same as authenticated submission on 587; follow the relay rule and Sendmail TLS requirements.
  5. Remove direct-mailbox credentials from hosts that no longer need them, rebuild the Sendmail configuration, and test one sender before migrating the rest.
  6. Monitor relay logs and Workspace controls for rejected sources, policy violations, and volume changes.

The relay service does not eliminate the need for transport security, source authorization, or logging. It changes where authorization is administered and can reduce the number of mailbox secrets that must be distributed.

Security and maintenance checklist

  • Use a dedicated app password rather than a primary Google account password.
  • Prefer OAuth 2.0 when the Sendmail integration can securely support token issuance and refresh.
  • Use STARTTLS on port 587 or correctly configured implicit TLS on port 465.
  • Keep CA trust configured through confCACERT and/or confCACERT_PATH; do not disable certificate verification to hide an error.
  • Ensure the authinfo key exactly matches the hostname in SMART_HOST.
  • Restrict permissions on authinfo source files, generated databases, backups, and Sendmail configuration.
  • Rotate or revoke credentials when a server is retired, a staff role changes, or a secret may have been exposed.
  • Review logs after configuration changes and during scheduled or alert-heavy sending periods.
  • Use Workspace SMTP relay when many devices or applications share an organizational sending function.

Configuration outcome

A correct direct setup has four observable properties: Sendmail routes through smtp.gmail.com; the selected port’s TLS mode is actually negotiated; Gmail receives the complete account identity and valid app-password or OAuth credentials through a protected authinfo configuration; and the host validates Gmail’s certificate against a trusted CA bundle. If any one of those properties is missing, fix that layer before changing unrelated mail settings.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.