{"id":721,"date":"2022-06-08T11:30:07","date_gmt":"2022-06-08T11:30:07","guid":{"rendered":"https:\/\/www.cubebackup.com\/blog\/?p=721"},"modified":"2022-06-08T12:01:01","modified_gmt":"2022-06-08T12:01:01","slug":"how-to-use-google-smtp-service-to-send-emails-for-free","status":"publish","type":"post","link":"https:\/\/www.cubebackup.com\/blog\/how-to-use-google-smtp-service-to-send-emails-for-free\/","title":{"rendered":"How to use Google SMTP service to send emails for free?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p>When building your website or application, sometimes you may need to send emails through an SMTP server. Instead of setting up your own mail server, it is usually better to employ a well-known mail service, such as Google\u2019s Gmail or Microsoft\u2019s Outlook.com, which are more reliable and less hassle overall.&nbsp; <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Benefits<\/h3>\n\n\n\n<p>First of all, Google\u2019s SMTP service is free.&nbsp; Second, it is very reliable.&nbsp; Third, Google\u2019s SMTP employs SSL\/TLS encryption, using port 465 or 587,&nbsp; which provides extra security to messages you send.<\/p>\n\n\n\n<p>Gmail is the No 1&nbsp;mail service in the world,&nbsp; and it is very powerful and convenient.&nbsp; Using the Gmail SMTP service, any message sent from your Gmail account can be searched and backed up in your Gmail Sent folder.<\/p>\n\n\n\n<p>However,&nbsp; for security reasons,&nbsp; Google no longer allows third-party apps to sign in using only a Google Account name and password.&nbsp; Instead, you must use one of the methods described in this tutorial.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Prerequisites and limitations<\/strong><\/h2>\n\n\n\n<p>To use Google\u2019s SMTP service, you need to have either:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>A free Gmail account, like&nbsp; someone@gmail.com,&nbsp; which allows you to send up to 500 emails per day.<\/li><li>A paid Google Workspace account, like&nbsp; someone@mycompany.com.&nbsp; Google Workspace accounts can send up to 2,000 messages per day.<\/li><li>If you\u2019d like to use Google Workspace SMTP relay service, you must be an administrator of your Google Workspace domain.&nbsp; Google\u2019s SMTP relay service allows you to send up to 10,000 messages per day.<\/li><\/ol>\n\n\n\n<p>In most cases, the quota limit for Google SMTP service is sufficient for small applications. If you need to send more than 10,000 messages per day, you will have to set up your own SMTP server, or employ a paid mail service. Actually, <a rel=\"noreferrer noopener\" href=\"https:\/\/cubebackup.com\" target=\"_blank\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">CubeBackup<\/span><\/a> employs <a rel=\"noreferrer noopener\" href=\"https:\/\/mailgun.com\" target=\"_blank\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">Mailgun&#8217;s<\/span><\/a> service for sending notification messages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Solutions<\/strong><\/h2>\n\n\n\n<p>To use Google\u2019s SMTP service to send emails from within your programs or scripts, please use one of the following methods :<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method1: \u00a0 Using App password for Google SMTP authentication.<\/h2>\n\n\n\n<p>Google\u2019s App Password is a 16-character passcode that gives a third-party app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">1:&nbsp; Create an App password.<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to your <a href=\"https:\/\/myaccount.google.com\/\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">Google Account<\/span>.<\/a>&nbsp;&nbsp;<\/li><li>On the left navigation panel, click <strong>Security<\/strong>.&nbsp;<\/li><li>Under the \u201cSigning in to Google\u201d section, if <strong>2-Step Verification<\/strong> is <strong>Off<\/strong> in your account, you need to select <strong>2-Step Verification<\/strong> and follow the on-screen steps to enable it.&nbsp;<\/li><li>Select <strong>App passwords<\/strong> in the&nbsp; \u201cSigning in to Google\u201d section. You may need to sign in again to confirm.&nbsp;<\/li><li>In the App passwords page, click <strong>Select app<\/strong> and choose \u201cMail\u201d, then click <strong>Select device<\/strong> and choose the device you\u2019re using. Finally, click <strong>GENERATE<\/strong>.<\/li><li>Follow the instructions to enter the App Password. The App Password is the 16-character code in the yellow bar on your device.<\/li><\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">2:&nbsp; Set up Google SMTP in your mail client or your application with the following settings:<\/h5>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>SMTP server<\/strong>: \u00a0smtp.gmail.com\u00a0<\/p><p><strong>SMTP port<\/strong>:\u00a0 \u00a0 \u00a0 587<\/p><p><strong>SMTP TLS\/SSL required<\/strong>: yes<\/p><p><strong>Authentication username<\/strong>: Your Gmail or Google Workspace account (<em>e.g.,\u00a0 someone@gmail.com or someone@company-domain.com<\/em>)<\/p><p><strong>Authentication password<\/strong>: The App password generated in step 1 (<em>e.g., vrdpivabcdexzwsj<\/em> ) <\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Method 2:&nbsp; Using the traditional Google SMTP service with \u201cLess secure app access\u201d enabled.<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Note: <\/strong><\/p><p>1. <em>This method only works for Google Workspace or Google Cloud Identity customers.<\/em><\/p><p><em>For security reasons,&nbsp; Google does not allow third-party apps to sign in using only your Google Account username and password.&nbsp; This method no longer works for free Gmail accounts, but only for Google Workspace or Google Cloud Identity customers.<\/em><\/p><p><em>2.  Enabling \u201c<strong>Less secure app access<\/strong>\u201d makes your account vulnerable.&nbsp; In most cases, we recommended \u201cMethod 1: using an app password for Google SMTP authentication\u201d or \u201cMethod 3: using Google SMTP relay service\u201d.&nbsp;<\/em><\/p><\/blockquote>\n\n\n\n<h5 class=\"wp-block-heading\">1:&nbsp; Turn on the&nbsp; \u201cLess secure app access\u201d&nbsp; option.<\/h5>\n\n\n\n<p>Log in to your <a href=\"https:\/\/myaccount.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">Google Account<\/span><\/a> using a Google Workspace account,&nbsp; select <strong>Security<\/strong> on the left panel, then click the \u201c<strong>Less secure app access<\/strong>\u201d section. On the next page, switch on \u201c<strong>Allow less secure apps<\/strong>\u201d.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2:&nbsp; Set up Google SMTP in your mail client or your application using the following settings:<\/h5>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>SMTP server<\/strong>: \u00a0smtp.gmail.com\u00a0<\/p><p><strong>SMTP port<\/strong>:\u00a0 \u00a0 \u00a0 587<\/p><p><strong>SMTP TLS\/SSL required<\/strong>: yes<\/p><p><strong>Authentication username<\/strong>: Your Google Workspace or Cloud Identity account (e.g., someone@company-domain.com)<\/p><p><strong>Authentication password<\/strong>: The password of your account.<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Method 3:&nbsp; Using Google Workspace SMTP relay service.<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong><em>Note<\/em><\/strong><em>:&nbsp; Google Workspace SMTP relay service is only available for paid Google Workspace domains, and it requires a Google Workspace administrator sign-in.&nbsp;&nbsp;&nbsp;<\/em><\/p><\/blockquote>\n\n\n\n<h5 class=\"wp-block-heading\">1:&nbsp; Create a rule for Google SMTP relay service&nbsp;<\/h5>\n\n\n\n<p>The Google Workspace SMTP relay service allows you to send email messages through Google. Please follow the instructions below:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Sign in to the <a href=\"https:\/\/admin.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">Google Admin Console<\/span><\/a>.<\/li><li>From the Admin console <strong>Home<\/strong> page, go to <strong>Apps &gt; Google Workspace &gt; Gmail &gt; Routing<\/strong>.<\/li><li>On the left, select the top-level organization, then click <strong>CONFIGURE<\/strong>&nbsp; for <strong>SMTP relay service<\/strong>.&nbsp; If&nbsp; the setting is already configured, click <strong>ADD ANOTHER RULE.<\/strong><\/li><li>In the \u201cAdd Setting\u201d dialog,&nbsp; enter a description for the SMTP relay service.&nbsp;<\/li><li>In the Allowed senders section, select the users who are allowed to send messages through the SMTP relay service. In most cases, you can select <strong>Only addresses in my domains<\/strong>.<\/li><li>In the Authentication section, check one or both boxes to set an authentication method.&nbsp; If your server has a static IP address, you should choose <strong>Only accept mail from the specified IP addresses<\/strong>, otherwise, select <strong>Require SMTP Authentication<\/strong>.&nbsp;&nbsp;&nbsp;&nbsp;<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Tip: <\/strong>If you choose to only accept messages from specified IP addresses, you will be asked to enter the IP address or IP address range.<\/p><\/blockquote>\n\n\n\n<ul class=\"wp-block-list\" start=\"7\"><li>In the Encryption section, check the <strong>Require TLS encryption<\/strong> box.<\/li><li>Click <strong>Save<\/strong>.<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Note: <\/strong>It can take up to 24 hours for changes to propagate to user accounts.&nbsp;<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><a href=\"https:\/\/www.cubebackup.com\/blog\/wp-content\/uploads\/2022\/06\/smtprelay.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.cubebackup.com\/blog\/wp-content\/uploads\/2022\/06\/smtprelay.png\" alt=\"Google SMTP relay service \" class=\"wp-image-752\" width=\"500\" height=\"600\"\/><\/a><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">2: Configure your email server to point to Gmail SMTP relay service.<\/h5>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>SMTP server<\/strong>: \u00a0<strong>smtp-relay.gmail.com<\/strong><\/p><p><strong>SMTP port<\/strong>:\u00a0 \u00a0 \u00a0 587<\/p><p><strong>SMTP TLS\/SSL required<\/strong>: yes<\/p><p><strong>Authentication username<\/strong>:\u00a0 This field can be ignored if \u201cIP Authentication\u201d is used.\u00a0 If \u201cSMTP Authentication\u201d is chosen in Step 1, you need to enter a Google Workspace account in your domain.<\/p><p><strong>Authentication password<\/strong>:\u00a0 This field can be ignored if \u201cIP Authentication\u201d is used. If \u201cSMTP Authentication\u201d is chosen in Step 1, you need to generate an App password for this field.<\/p><\/blockquote>\n\n\n\n<p>For more information about Google SMTP relay service, see &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"https:\/\/support.google.com\/a\/answer\/2956491?product_name=UnuFlow&amp;hl=en&amp;visit_id=637879402580941434-3448939699&amp;rd=1&amp;src=supportwidget0&amp;hl=en\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">https:\/\/support.google.com\/a\/answer\/2956491?product_name=UnuFlow&amp;hl=en&amp;visit_id=637879402580941434-3448939699&amp;rd=1&amp;src=supportwidget0&amp;hl=en<\/span><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Suggestions<\/h2>\n\n\n\n<p>&nbsp;To prevent your emails from falling into the Spam folder, please keep the following guidelines in mind:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Don\u2019t spam. This may result in the blocking of your Google account.&nbsp; Spamming will also hurt the sender\u2019s domain reputation.<\/li><li>Start by sending a few emails at a time and slowly ramp up to higher volumes.&nbsp; Do not send a large number of emails all at once.<\/li><li>Use Google Workspace SMTP relay service if possible.&nbsp; This method authenticates your email as genuinely coming from you. This is one of several important signals Google and other spam filters use to determine the validity of your email.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>By following this tutorial, you can integrate mail sending functionalities into your application or script by using Google\u2019s SMTP service.&nbsp; In most cases, Google\u2019s reliable and free SMTP service will be sufficient to meet your needs, freeing you from the need to build and maintain your own mail server.&nbsp; Google offers more options for Google Workspace users,&nbsp; so your options and methods may change depending on whether you are a Gmail user or a Google Workspace user. <\/p>\n\n\n\n<p>If you are using <a href=\"https:\/\/www.cubebackup.com\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">CubeBackup to protect your Google Workspace data<\/span><\/a>,  please refer to <a rel=\"noreferrer noopener\" href=\"https:\/\/www.cubebackup.com\/docs\/faq\/email-report-notification\/\" data-type=\"URL\" data-id=\"https:\/\/www.cubebackup.com\/docs\/faq\/email-report-notification\/\" target=\"_blank\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">SMTP setttings for CubeBackup<\/span><\/a> for more information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction When building your website or application, sometimes you may need to send emails through an SMTP server. Instead of setting up your own mail server, it is usually better to employ a well-known mail service, such as Google\u2019s Gmail or Microsoft\u2019s Outlook.com, which are more reliable and less hassle overall.&nbsp; Benefits First of all, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"zakra_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-721","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":49,"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":775,"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/posts\/721\/revisions\/775"}],"wp:attachment":[{"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cubebackup.com\/blog\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}