[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

send mail from command line using Gmail

Posted on 2016-09-05
5
Medium Priority
?
122 Views
Last Modified: 2016-09-10
Hi

I can't despite my many efforst find a means to send an email from the command line on my Win2012r2 server

The idea is to use the Task Scheduler to send these but whatever utility I try ex. sendemail, switch-mail, mailsend
it just fails, here is the output from mailsend:

Winsock error[10060]: A connection attempt failed because the connected party di
d not properly respond after a period of time, or established connection failed
because connected host has failed to respond.

Error: Connection is closed unexpectedly
Could not send mail

this is my syntax:

mailsend.exe -t xxxxx@different.com -f xxxx@gmail.com -starttls -port 465 -auth -smtp smtp.gmail.com -sub test -M test -user xxxxxx@gmail.com -pass xxxxxxxxxxxxxxxxx

Open in new window


I tried disabling the anti-virus: same result
Thunderbird which is on this computer communicates quite successfully with Gmail.

thanks
yann
0
Comment
Question by:Yann Shukor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 37

Assisted Solution

by:bbao
bbao earned 1000 total points
ID: 41784623
0
 
LVL 9

Assisted Solution

by:Tomas Valenta
Tomas Valenta earned 1000 total points
ID: 41784670
If you are using Google Apps you can do it by sending messages to
the server smtp-relay.gmail.com and by adding your public
IP address what will messages send to allowed hosts in Google Admin console.
0
 
LVL 9

Expert Comment

by:Tomas Valenta
ID: 41784675
If you have free Gmail account you need to enable IMAP/POP3 access to this mailbox
and add authentication in your script:
https://github.com/muquit/mailsend/blob/master/doc/examples.mediawiki#SSL__AUTHENTICATION
0
 

Accepted Solution

by:
Yann Shukor earned 0 total points
ID: 41784684
Hi

I just realised my mistake

I have enabled two factor authentication on my Google account !

I will have to create a special purpose password for this to function !

thanks all the same

yann
0
 

Author Closing Comment

by:Yann Shukor
ID: 41792501
sorted
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google is more than just a search engine. Over the years the company has developed a wide range of online services that are readily available to all users. This article highlights how one can use Google services for simple project management.
OfficeMate Freezes on login or does not load after login credentials are input.
This Micro Tutorial  demonstrates whether your site uses one subdomain or multiple subdomains, how to create full URLs from Google Analytics content reports. This procedure is called concatenation and can also be done with the CONCATENTATE function.…
This Micro Tutorial demonstrates in Google Analytics how to create a custom report that shows you traffic over time using the month of year dimensions. There are also instructions on how to fix Google's odd month of year formatting, which Microsoft …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question