Community discussions

MikroTik App
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Dude - Email notifications through Gmail on Windows - via mailsend

Tue May 20, 2014 12:44 pm

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

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.
You do not have the required permissions to view the files attached to this post.
Last edited by stmx38 on Thu Aug 03, 2023 11:42 am, edited 14 times in total.
 
User avatar
scotthammersley
Member Candidate
Member Candidate
Posts: 230
Joined: Fri Feb 22, 2013 7:16 pm
Location: Jackson, MS
Contact:

Re: Email notification through Gmail on Windows - via mailse

Tue May 20, 2014 5:46 pm

That's a great idea! You should post this on the Wiki as well.
 
User avatar
rickfrey
Trainer
Trainer
Posts: 609
Joined: Sun Feb 14, 2010 11:41 pm
Location: Van, Texas
Contact:

Re: Email notification through Gmail on Windows - via mailsend.

Wed Jun 24, 2015 3:43 am

Works great! Thank you! :D
 
User avatar
davidnvega
just joined
Posts: 21
Joined: Wed Aug 28, 2013 11:11 pm
Location: San Juan, Argentina
Contact:

Re: Email notification through Gmail on Windows - via mailsend.

Mon Nov 02, 2015 3:56 am

Related solutions:
Send mail via server which require SMTP authentication
Email notification through Gmail on Windows - via blat.

Requirements:
1. Mailsend
3. Dude server on windows machine
4. 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.
Image

Hope this will help someone.

Is there any way to set a CC??
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows - via mailsend.

Mon Nov 02, 2015 12:08 pm

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
Last edited by stmx38 on Tue Mar 22, 2022 7:51 am, edited 1 time in total.
 
quadra74
just joined
Posts: 4
Joined: Thu Sep 17, 2015 10:23 am

Re: Email notification through Gmail on Windows - via mailsend.

Tue Nov 17, 2015 1:06 am

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
You do not have the required permissions to view the files attached to this post.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows - via mailsend.

Tue Nov 17, 2015 10:23 am

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!
 
quadra74
just joined
Posts: 4
Joined: Thu Sep 17, 2015 10:23 am

Re: Email notification through Gmail on Windows - via mailsend.

Wed Nov 18, 2015 12:53 am

Hello slech

Merci pour tes infos

par contre que faut il mettre en serveur ??
You do not have the required permissions to view the files attached to this post.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Email notification through Gmail on Windows - via mailsend.

Wed Nov 18, 2015 7:53 am

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 Test button
Thank you!
Last edited by stmx38 on Tue Mar 22, 2022 7:52 am, edited 1 time in total.
 
luckysatriadzudin
just joined
Posts: 9
Joined: Fri May 20, 2016 1:14 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri May 20, 2016 5:08 pm

i have trouble, how to fix it ???
You do not have the required permissions to view the files attached to this post.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri May 20, 2016 5:15 pm

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!
Last edited by stmx38 on Tue Mar 22, 2022 7:56 am, edited 1 time in total.
 
luckysatriadzudin
just joined
Posts: 9
Joined: Fri May 20, 2016 1:14 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri May 20, 2016 7:08 pm

i save selected code
(nslookup,ping,telnet) smtp.gmail.com,
with format dll where i install the dude in C:
and result
 
luckysatriadzudin
just joined
Posts: 9
Joined: Fri May 20, 2016 1:14 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri May 20, 2016 7:09 pm

i save selected code
(nslookup,ping,telnet) smtp.gmail.com,
with format dll where i install the dude in C:
and result
You do not have the required permissions to view the files attached to this post.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri May 20, 2016 7:58 pm

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.
 
luckysatriadzudin
just joined
Posts: 9
Joined: Fri May 20, 2016 1:14 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon May 23, 2016 12:50 pm

finnaly , gateway email has been send, i not used mailsend so i used smtp for isp or vendor , thanks a lot for help
You do not have the required permissions to view the files attached to this post.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon May 23, 2016 2:08 pm

luckysatriadzudin, thank you for feedback!
 
Kincaidc
just joined
Posts: 11
Joined: Fri Jul 22, 2016 10:28 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri Jul 22, 2016 10:34 pm

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
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Sat Jul 23, 2016 9:22 am

Hello Kincaidc!

What version of The Dude do you use ?
Last edited by stmx38 on Mon Jul 25, 2016 4:16 pm, edited 1 time in total.
 
Kincaidc
just joined
Posts: 11
Joined: Fri Jul 22, 2016 10:28 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon Jul 25, 2016 4:02 pm

version 3.6
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon Jul 25, 2016 4:29 pm

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!
 
Kincaidc
just joined
Posts: 11
Joined: Fri Jul 22, 2016 10:28 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon Jul 25, 2016 4:41 pm

yeah that does nothing for me. I cannot get a screenshot it open and closes. thanks for your help anyways. Ill probably look into changing monitoring software
 
Kincaidc
just joined
Posts: 11
Joined: Fri Jul 22, 2016 10:28 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon Jul 25, 2016 6:56 pm

Ok here is what I captured
You do not have the required permissions to view the files attached to this post.
Last edited by Kincaidc on Thu Jul 28, 2016 9:10 am, edited 1 time in total.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Tue Jul 26, 2016 8:54 am

Kincaidc,

Please, remove image(all text) from your recent post and change your password on gmail account.

Then you can repeat log capturing, but please be aware with your credentials gain. You posted them in last line of your screen.
1. Scroll down appeared windows - message from mail server is on last line.
2. Instead of creating screenshot you can just copy text from this windows: Right click on black area --> Mark --> Select the text with mouse --> Press Enter(=Ctrl+C) --> Press Ctrl+V on the forum.

We need just last lines where gmail server reply.

Thank you!
 
Kincaidc
just joined
Posts: 11
Joined: Fri Jul 22, 2016 10:28 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Tue Jul 26, 2016 3:56 pm

I see that. It is a bogus email address anyway. It no longer exists, I deleted the account. the email notifications are not going to work for me. I thank you for your time but the script just does not work for me.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Tue Jul 26, 2016 5:11 pm

Kincaidc,

I just verified if it working:
1. Start --> Run --> cmd --> Enter
2. "c:\Program Files (x86)\Dude\mailsend\mailsend.cmd" "Test Subject" "Test Body"

And all works.

Also added Troubleshooting section in instruction.

Good luck!
 
Kincaidc
just joined
Posts: 11
Joined: Fri Jul 22, 2016 10:28 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Thu Jul 28, 2016 9:04 am

Thanks for the help Slech it works like a charm. I did have a question. If we are using this mailsend.cmd to execute and email notification to gmail my gut tells me I can change the script to reflect the correct smtp server as well as port number of our local exchange server and have the dude send notifications direclty to me rather than gmail and then setting up rules to forward them to the exchange account. I have not tried it but why wouldn't that work
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Thu Jul 28, 2016 9:31 am

Hello, Kincaidc!

Glad to hear that all is working!

It should work with Microsoft Exchange. You can conside '-ssl' option in mailsend.cmd. If your exchange does not support this you should remove it from file.
For more information you can see https://github.com/muquit/mailsend/blob ... .mediawiki

Also found in Google the following article: Send Email from a .bat script.
 
User avatar
43north
Member Candidate
Member Candidate
Posts: 208
Joined: Fri Nov 14, 2014 7:06 am

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Sun Aug 14, 2016 2:38 am

I thought I should update this thread as I have found a solution for email notifications DIRECTLY through The Dude without any other junk....

If you have a Gmail account then enter this SMTP server in the dude for primary SMTP.... aspmx.l.google.com (you will have to resolve it to an ip address to input into dude). Then use your gmail address for the send to address and that is it!!! Have had email notifications up and running with this for over a week!!! This particular SMTP server DOES NOT require authentication as long as it is going to a Gmail account, that is why it will work in the Dude.
 
purplemanis
just joined
Posts: 1
Joined: Tue Sep 13, 2016 10:08 am

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Tue Sep 13, 2016 1:33 pm

why displayed like this, is can't work
You do not have the required permissions to view the files attached to this post.
 
j12345h
just joined
Posts: 1
Joined: Wed Mar 08, 2017 7:48 am

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Wed Mar 08, 2017 7:52 am

I'm not sure I follow this so much. How do I create a cmd file within the directory of the mailsend folder?
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Wed Mar 08, 2017 10:05 am

j12345h,

I think we can do this in two ways:
a) Using Windows explorer:
1. Go to the mailsend folder, in our example it is "C:\Program Files (x86)\Dude\mailsend"
2. Right click --> New --> Text Document. Now you should see "New Text Document.txt". If you see only "New Text Document" without ".txt" at the end you should change your windows explorer settings in order to display files extensions. For more information please see article from Microsoft: How to show or hide file name extensions in Windows Explorer.
3. Right click on the "New Text Document.txt" --> Rename --> mailsend.cmd --> Enter

b) Using command-line interface:
1. Start --> Run --> cmd --> Enter
2. Type:
echo > "C:\Program Files (x86)\Dude\mailsend\mailsend.cmd"
and press Enter
For this, folder C:\Program Files (x86)\Dude\mailsend should exists before command execution.

Now you have a mailsend.cmd file. To modify it: Right click on mailsend.cmd --> Edit

Thank you!
 
lodilodilodi
newbie
Posts: 31
Joined: Thu Feb 01, 2018 10:24 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Thu Feb 01, 2018 10:35 pm

when i add notification in dude and then add notification in one ip it says down and ping is up, i reboot the device and i dont get any email. if i use test email work well . what is the problem ? Image
 
eriitguy
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jan 26, 2017 1:16 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri Feb 02, 2018 9:15 am

Hello, lodilodilodi!

May you please verify if in the Polling tab a checkbox is checked for Email notification you have configured?


Thank you!
 
lodilodilodi
newbie
Posts: 31
Joined: Thu Feb 01, 2018 10:24 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Fri Feb 02, 2018 12:40 pm

Hello, lodilodilodi!

May you please verify if in the Polling tab a checkbox is checked for Email notification you have configured?


Thank you!
You just save my life :) thank you .
 
lodilodilodi
newbie
Posts: 31
Joined: Thu Feb 01, 2018 10:24 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon Feb 05, 2018 11:35 am

hello again , how can i sent notification to multiple emails at the same time .

Example :

set mailto=username@gmail.com
set mailto=username1@gmail.com

Thank You.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Mon Feb 05, 2018 8:23 pm

Hello, lodilodilodi!

We may try to specify all required addresses in one line:
set mailto=username@gmail.com,username1@gmail.com

Thank you!
 
sebasGST
just joined
Posts: 8
Joined: Fri Sep 06, 2019 6:41 pm

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Thu Jan 16, 2020 7:05 pm

Hi i recently installed the dude v4.0beta 3 in my pc, the email in the app doesn´t work says "INVALID TO ADRESS", im serching in the forums and i found this, the cmd works ok but in need to press the (.) dot buttom to send, can you help me please??
You do not have the required permissions to view the files attached to this post.
 
User avatar
stmx38
Long time Member
Long time Member
Topic Author
Posts: 617
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Dude - Email notification through Gmail on Windows - via mailsend.

Sat Jan 18, 2020 1:06 am

Hi i recently installed the dude v4.0beta 3 in my pc, the email in the app doesn´t work says "INVALID TO ADRESS", im serching in the forums and i found this, the cmd works ok but in need to press the (.) dot buttom to send, can you help me please??
How did you test it? You should try to test it by pressing Test button in The Dude.

On your screen we probably see that you just double clicked on the created file and it asked you to provide message body.

Please follow guide step-by-step and provide information on which one you have an issue.

Who is online

Users browsing this forum: No registered users and 8 guests