Send Email using Macrodroid's "Send Email"

mdman2021

New member
I am having a difficult time sending an email using Macrodroid's "Send Email" Action.

Here's my macro:
Trigger: Empty Trigger
Action: Send Email
Select Option: Gmail Account
Email Address: (my_email)@gmail.com
Subject: Testing Macrodroid's Send Email
Message Text: Test #1

The action is created successfully. Next, I tap on the newly created Action and tap on "Test action".

In Macrodroid's System Log, I see:
14:51:30 Upload Service created
14:51:35 Uploading to Email
14:51:35 Using OAUTH
14:52:06 Uploading to Email
14:52:06 Using OAUTH
14:52:36 Uploading to Email
14:52:36 Using OAUTH
14:52:36 Upload Service Destroyed

What am I doing wrong? Any ideas?
 

tanutanu

Well-known member
I am having a difficult time sending an email using Macrodroid's "Send Email" Action.

Here's my macro:
Trigger: Empty Trigger
Action: Send Email
Select Option: Gmail Account
Email Address: (my_email)@gmail.com
Subject: Testing Macrodroid's Send Email
Message Text: Test #1

The action is created successfully. Next, I tap on the newly created Action and tap on "Test action".

In Macrodroid's System Log, I see:
14:51:30 Upload Service created
14:51:35 Uploading to Email
14:51:35 Using OAUTH
14:52:06 Uploading to Email
14:52:06 Using OAUTH
14:52:36 Uploading to Email
14:52:36 Using OAUTH
14:52:36 Upload Service Destroyed

What am I doing wrong? Any ideas?
If you send the email via Google, you have to authorize the macro activity on your Google account secure settings. Normally you got the notification but it failed due to a certain reason. However, you got an alert email from Google. It lead you the confirmation section.
 

tanutanu

Well-known member
What do you mean by "authorize the macro activity on your Google account"?
Before you ask me, you need to make sure you sent an email via Google.
If so, you got a notification and security alert email. It navigate you how to do.
If not but your service provider gives you SMTP with oAUTH option, you should follow their instructions.
 

Attachments

  • IMG_20211012_162111.jpg
    IMG_20211012_162111.jpg
    149.8 KB · Views: 28
Last edited:

tanutanu

Well-known member
What do you mean by "authorize the macro activity on your Google account"?
I revoked my authorized MD permission and proceeded it again just for you. It might help OP as well.
 

Attachments

  • IMG_20211012_205903.jpg
    IMG_20211012_205903.jpg
    120.7 KB · Views: 56
  • IMG_20211012_210004.jpg
    IMG_20211012_210004.jpg
    278.6 KB · Views: 52
  • IMG_20211012_210117.jpg
    IMG_20211012_210117.jpg
    180.8 KB · Views: 48

mdman2021

New member
I revoked my authorized MD permission and proceeded it again just for you. It might help OP as well.
When I first started testing this "Send email" (using Macrodroid) I did see a warning in Google saying someone (or something) tried to login to my Google account and I said "Yes, it was me". Now, when I go to my Google account I see only 4 "Apps with access to my (Google) account" and Macrodroid is NOT one of them.

Next, I tried to set ALLOW "Less secure app access" to ON. But the "Send email" (using Macrodroid) still shows the same messages in Macrodroid's System Log -and- there are no warning messages in Google saying anything tried to login.

EXACTLY how did you "...revoked my authorized MD permission..."?? Maybe If I try that it will break the log jam.
 

tanutanu

Well-known member
EXACTLY how did you "...revoked my authorized MD permission..."?? Maybe If I try that it will break the log jam.
I did it on my Google account page.
If you can't find it, email permission is not granted.
Try again on MD send email action as a test tapping 'test action' in the context menu
 

Attachments

  • IMG_20211014_034427.jpg
    IMG_20211014_034427.jpg
    239.6 KB · Views: 34
  • IMG_20211014_034552.jpg
    IMG_20211014_034552.jpg
    252.4 KB · Views: 33
Last edited:

mdman2021

New member
I did it on my Google account page.
If you can't find it, email permission is not granted.
Try again on MD send email action as a test tapping 'test action' in the context menu
tanutanu,
First, thanks for helping me with this but as you can see, in my original post, I have tried the Macrodroid "Test action". After initiating the "Test action", I go to the Macrodroid System Log where I see (in real time) the slow scrolling "Using OAUTH" messages. I put these messages into my original post.

Anyway, here's what I did (as you suggested):
1) I went to "https://www.google.com"
2) Clicked on my Avatar in the upper right corner and I see my name and login ID (so this means I am logged in)
3) In that same pull-down, I clicked on "Manage your Google Account"
4) Clicked on "You have security recommendations"
5) Clicked on "Third-party access"
6) Scrolled down and saw "4 apps with access to your data". Each of these apps has a "Remove access" button next to it.

The thing is, of these 4 apps, NONE are Macrodroid !! The apps are: Microsoft, Microsoft apps & services, Nest (thermostat), and SmartThings Nest Integration -- but NOT Macrodroid. ALSO, I turned on the switch called "Turn off less secure app access" -- meaning less secure apps are allowed access. But the "Using OAUTH" messages, followed by failure to send the email, continues.

Because the Macrodroid System Log shows "Using OAUTH", I'm thinking I need an OAUTH key (which is like an 8-10 character password) which I should then use in place of my Google login password. To get this OAUTH key, I somehow have to generate it in Google -- but I don't know how to do that without first creating a Developers Project and a whole series of steps like I need the OAUTH key because I am writing an App. I should think I could easily create an OAUTH key.

Does this sound promising?
 

mdman2021

New member
SUCCESS!!! I figured it out. The solution is, I needed to log into my Google account and set an "App Password" for the App I named "Macrodroid". When creating the App Password, I probably could have named it anything I wanted because I think the name I chose ("Macrodroid") is just a name it uses when showing me the list of ALL of my "App Passwords". This seems to imply I can have an "App Password" for many apps (like one for Macrodroid, and different one for Tasker, etc., etc.). This way I could remove access to my Google gmail by deleting the "App Password" for the corresponding app. This "App Password" process generates 16-digit password which you then use as the email password (instead of your actual email password) in the Macrodroid "Send email" action.

Here is the Google knowledge base article "https://support.google.com/accounts/answer/185833".

Here's part of what is in the link I provided:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.
^^^^^^^^^^^^^^^^^^^^

Part of the process to get this to work was I had to turn on "2-Step Verification" for my Google account which is something that was NOT on.

Now the Macrodroid System Log shows the following SUCCESSFUL log messages:
(see original post for FAILURE log messages)
. . .
16:46:35 Upload Service created
16:46:40 Uploading to Email
16:46:40 Using email password
16:46:42 Email was sent to: (my_email)@gmail.com
16:46:42 Upload Service destroyed


I hope this helps others. Cheers!
 
  • Like
Reactions: 420

tanutanu

Well-known member
SUCCESS!!! I figured it out. The solution is, I needed to log into my Google account and set an "App Password" for the App I named "Macrodroid". When creating the App Password, I probably could have named it anything I wanted because I think the name I chose ("Macrodroid") is just a name it uses when showing me the list of ALL of my "App Passwords". This seems to imply I can have an "App Password" for many apps (like one for Macrodroid, and different one for Tasker, etc., etc.). This way I could remove access to my Google gmail by deleting the "App Password" for the corresponding app. This "App Password" process generates 16-digit password which you then use as the email password (instead of your actual email password) in the Macrodroid "Send email" action.

Here is the Google knowledge base article "https://support.google.com/accounts/answer/185833".

Here's part of what is in the link I provided:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.
^^^^^^^^^^^^^^^^^^^^

Part of the process to get this to work was I had to turn on "2-Step Verification" for my Google account which is something that was NOT on.

Now the Macrodroid System Log shows the following SUCCESSFUL log messages:
(see original post for FAILURE log messages)
. . .
16:46:35 Upload Service created
16:46:40 Uploading to Email
16:46:40 Using email password
16:46:42 Email was sent to: (my_email)@gmail.com
16:46:42 Upload Service destroyed


I hope this helps others. Cheers!
OK, you just didn't set up the app password for MD. So the parmission for MD was actually set at first, just you needed to follow Google instruction as it showed on the 3rd party app control section. I did it at first, so I naturally think it everybody did it. I'm glad to lead you to the problem focal point and make the opportunity to reach the goal:)
 
Last edited:

tanutanu

Well-known member
SUCCESS!!! I figured it out. The solution is, I needed to log into my Google account and set an "App Password" for the App I named "Macrodroid". When creating the App Password, I probably could have named it anything I wanted because I think the name I chose ("Macrodroid") is just a name it uses when showing me the list of ALL of my "App Passwords". This seems to imply I can have an "App Password" for many apps (like one for Macrodroid, and different one for Tasker, etc., etc.). This way I could remove access to my Google gmail by deleting the "App Password" for the corresponding app. This "App Password" process generates 16-digit password which you then use as the email password (instead of your actual email password) in the Macrodroid "Send email" action.

Here is the Google knowledge base article "https://support.google.com/accounts/answer/185833".

Here's part of what is in the link I provided:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.
^^^^^^^^^^^^^^^^^^^^

Part of the process to get this to work was I had to turn on "2-Step Verification" for my Google account which is something that was NOT on.

Now the Macrodroid System Log shows the following SUCCESSFUL log messages:
(see original post for FAILURE log messages)
. . .
16:46:35 Upload Service created
16:46:40 Uploading to Email
16:46:40 Using email password
16:46:42 Email was sent to: (my_email)@gmail.com
16:46:42 Upload Service destroyed


I hope this helps others. Cheers!
And one more thing.
I recommend you to set up 2FA with authenticator app and Google prompt. While the covid-19 outbreak, I changed all passwords for over 200 services individualiy and make them managed by BitWarden and Authy. It' makes your accounts secure, safe and easy to manage, plus reduced such annoying issues. You no longer need app password unless using legacy iOS devices. Worth trying.
 
Top