SMTPSendMail with Gmail (SOLVED) - enable "Less Secure Apps"

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Dorian (MJT support)
Automation Wizard
Posts: 440
Joined: Sun Nov 03, 2002 3:19 am
Contact:

SMTPSendMail with Gmail (SOLVED) - enable "Less Secure Apps"

Post by Dorian (MJT support) » Mon Apr 29, 2019 11:21 pm

We recently had a customer over at the support desk who just couldn't seem to get Macro Scheduler to send emails via Gmail. Although he was doing everything right, the email never got sent. There were no errors and SMTP_RESULT was always blank - it just didn't work.

Here's the code I gave him, which worked for me (of course using correct login credentials) :

Code: Select all

Let>myMsg=Hello there

Let>mySbj=Here is a message

Let>SMTP_SSL=1
Let>SMTP_PORT=465
Let>SMTP_AUTH=1
Let>SMTP_USERID=me@gmail.com
Let>SMTP_PASSWORD=p4ssword
Let>SENDMAIL_STATUS=1
Let>SMTPServer=smtp.gmail.com

Let>me=me@gmail.com
Let>myname=Dorian Ellis
Let>recipients=recipient@gmail.com
SMTPSendMail>recipients,%SMTPServer%,me,myname,mySbj,myMsg,
MessageModal>Result of SendMail: %SMTP_RESULT%
After a lot of back and forth, head scratching, and replies that contained the word "nope", we had a Eureka moment. He needed to turn this on :

Allow Less Secure Apps :
https://myaccount.google.com/u/1/lessse ... ageId=none

As soon as he enabled that, it successfully sent emails. Maybe this post will prevent future head-scratching.
Always accepting custom script commissions. Message me or go here

Post Reply