From 2a0430c4ae7ad10edf820ef7cfcdbb9a22de9141 Mon Sep 17 00:00:00 2001
From: Andrea Mazzoleni
1. Create the file: Create a file named .netrc in the home directory of the user specified in notify_run_as_user.
machine smtp.gmail.com
login your_email@gmail.com
password your-16-char-app-password
+
Note: You must use a Google "App Password," not your primary account password.
@@ -981,9 +983,11 @@ Note: You must use a Google "App Password," not your primary account password.3. Configure the Command:
+
notify_result = curl --netrc --url smtps://smtp.gmail.com:465 --ssl-reqd --mail-from your_email@gmail.com --mail-rcpt your_email@gmail.com --upload-file -+ @@ -1000,25 +1004,31 @@ To send notifications through Gmail from a Windows Service, you have two primary
machine smtp.gmail.com login your_email@gmail.com password your-16-char-app-password+
Ensure only SYSTEM and Administrators have NTFS read access to this file. Use the following configuration:
+
notify_result = curl.exe --netrc --url "smtps://smtp.gmail.com:465" --ssl-reqd --mail-from "your_email@gmail.com" --mail-rcpt "your_email@gmail.com" --upload-file -+
Option 2: Using Command Line Credentials
If you cannot use a file, you can pass your Gmail credentials directly via the --user flag. Note that this is less secure as the app password may be visible in process monitoring tools.
notify_result = curl.exe --user "your_email@gmail.com:your-app-password" --url "smtps://smtp.gmail.com:465" --ssl-reqd --mail-from "your_email@gmail.com" --mail-rcpt "your_email@gmail.com" --upload-file -+