Dude - Email notifications through Gmail on Windows - via mailsend

Related solutions
Send mail via server which require SMTP authentication
Dude - Email notifications through Gmail on Windows - via blat
Dude v6 - SMS notifications
Dude v6 - Email notification through Gmail

Requirements

  1. Mailsend
  2. Dude server on windows machine
  3. Gmail account

Setup instruction
1. Download mailsend, rename it to mailsend.exe and place it in to C:\Program Files (x86)\Dude\mailsend directory.

2. In directory from p.1 create mailsend.cmd file with the following content:

:: Send email notifications from Dude via Gmail
:: 
set mailsenderdir=C:\Program Files (x86)\Dude\mailsend
set mailsender=mailsend.exe
set smtpsender=username@gmail.com
set smtpsenderfullname=username
set smtpserver=smtp.gmail.com
set smtpport=465
set smtpuser=username@gmail.com
set smtppwd=password
set mailto=username@gmail.com
::
::
"%mailsenderdir%\%mailsender%" -smtp %smtpserver% -port %smtpport% -ssl -auth -user %smtpuser% -pass %smtppwd% -t %mailto% -f %smtpsender% -name "%smtpsenderfullname%" +cc +bc -q -sub %1 -M %2
::
:: pause
::

change in it: smtpsender, smtpsenderfullname, smtpuser, smtppwd, mailto

3. Create new Notification
Name: Email-mailsend
Type: execute on server

"C:\Program Files (x86)\Dude\mailsend\mailsend.cmd" "Service [Probe.Name] on [Device.Name] is now [Service.Status]" "Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])"

And test it via pressing Test button

4. Now you can use it:
Device → Settings → Polling:
Notification: ✓ Email-mailsend

5. See the results:
Dude-Email-notification-throughout-Gmail-on-Windows-machine-01.png
Troubleshooting
If you can’t get it working you can try:

  1. Uncomment pause command from mailsend.cmd file and then press Test button in The Dude.
    Command windows should appear and wait until you press any key to close and you can see in last line message from Gmail server(or your Email server).
  2. If you need help, please copy these last lines from p.1 and paste them in this topic:
Right click on black area --> Mark --> Select the text with mouse --> Press Enter(=Ctrl+C) --> Press Ctrl+V on the forum

Please be aware to not disclose your username and password!

Gmail can ask you to change account settings: Allowing less secure apps to access your account.

That’s a great idea! You should post this on the Wiki as well.

Works great! Thank you! :smiley:

Is there any way to set a CC??

davidnvega, it seems that code for cc will be:

mailsend.cmd (with cc)

:: Send email notifications from Dude via Gmail
::
set mailsenderdir=C:\Program Files (x86)\Dude\mailsend
set mailsender=mailsend.exe
set smtpsender=username@gmail.com
set smtpsenderfullname=username
set smtpserver=smtp.gmail.com
set smtpport=465
set smtpuser=username@gmail.com
set smtppwd=password
set mailto=username@gmail.com
set mailtocc=usernamecc@gmail.com
::
::
"%mailsenderdir%\%mailsender%" -smtp %smtpserver% -port %smtpport% -ssl -auth -user %smtpuser% -pass %smtppwd% -t %mailto% -cc %mailtocc% -f %smtpsender% -name "%smtpsenderfullname%" +bc -q -sub %1 -M %2
::
:: pause
::

change in it: smtpsender, smtpsenderfullname, smtpuser, smtppwd, mailto, mailtocc

Salut a tous

je comprends vraiment rien a ton mailsend… désolé je suis novice…

quand je télécharge mailsend j’ai 3 fichiers

j’ai renommer mailsend en exe et cmd

ensuite je les mit dans le répertoire dude et après ???

merci pour ton aide

Hello quadra74!

  1. You should download mailsend1.18.exe.zip
  2. Extract mailsend1.18.exe
  3. Rename mailsend1.18.exe to mailsend.exe

Thank you!

Hello slech

Merci pour tes infos

par contre que faut il mettre en serveur ??

Hello quadra74!

You should add another type of notification Execute on server:

3. > Create new Notification
Name: > Email-mailsend
Type: > execute on server

“C:\Program Files (x86)\Dude\mailsend\mailsend.cmd” “Service [Probe.Name] on [Device.Name] is now [Service.Status]” “Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])”

>
> And test it via pressing > [u]Test[/u] > button

Thank you!

i have trouble, how to fix it ???
MASALAH TERKAHIR.png

luckysatriadzudin, it seems that the issue is related to the connection to the host smtp.gmail.com.
Please to run the following commands on server where Dude is installed and post results here:
Test Gmail connection

nslookup smtp.gmail.com
ping smtp.gmail.com
telnet smtp.gmail.com 465

Thank you!

i save selected code
(nslookup,ping,telnet) smtp.gmail.com,
with format dll where i install the dude in C:
and result

i save selected code
(nslookup,ping,telnet) smtp.gmail.com,
with format dll where i install the dude in C:
and result
456.png
123.png
result.png

luckysatriadzudin, thank you for the results!

  1. nslookup is ok.
  2. ping is ok.
  3. telnet is not ok. Please use entire command with port 465 on the end:
telnet smtp.gmail.com 465

.

And anyway from your last screen I can see that connection was successfully and the issue with authorization at the moment.

Please try again and copy link Gmail provide you and log in via Web Browser using this link. It maybe related to the Less secure apps.

finnaly , gateway email has been send, i not used mailsend so i used smtp for isp or vendor , thanks a lot for help
Untitled.png

luckysatriadzudin, thank you for feedback!

I have created the notification, mailsend folder and script. I cannot get it to send to a gmail account. I did change it from execute on server to execute locally and the exe file opened and closed when I tested it bust still no email. I am able to nslook up gmails smtp as well as ping it and telnet into it so I am not sure what is going on here. Should the mailsend folder be created on the dude server if it is set to execute on the server? Sorry for the lack of knowledge I know nothing about the dude

Hello Kincaidc!

What version of The Dude do you use ?

version 3.6

Kincaidc,

Please uncomment pause command in mailsend.cmd file. And after this pres Test button in you notification.
If your notification is Execute localy - a black window should appear where you can see sending status.

Copy and paste text you see for future analysis: right click → mark → select the text → Enter(=Ctrl+C) → Ctrl+V.
Please be aware to not disclose user and password.

Thank you!