1

I am trying to send an rmail with sendemail. installed via macports. What is wrong in the following and how do I go about fixing it?

bash-3.2$ sendemail -f [email protected] -u files -m message -t [email protected] -s smtp.gmail.com -a ~/temp/folder/*pdf
Jan 31 01:49:43 mycomp sendemail[10391]: ERROR => Connection attempt to smtp.gmail.com:25 failed: IO::Socket::INET: connect: Connection refused

2 Answers 2

3

Gmail wont accept connection without TLS support and the specific port 587 for it. Read it here. Execute the following -

sendemail -f [email protected] -u files -m message -t [email protected] -s smtp.gmail.com:587 -o tls=yes -a ~/temp/folder/*pdf

If this doesn't work, then provide your SMTP username and password with -xu and -xp options respectively.

0
0

I had faced the same issue and could resolve it. You can use the tls auto, 587 port command. Able to successfully send an email using Gmail SMTP.

sendemail -f "[email protected]" -u "Re : Alerts Script" -t "$EMAILS" -s "smtp.gmail.com:587" -o tls=auto -xu "[email protected]" -xp "Password" -m "$Msg"

Also, you have to apply couple of settings in Gmail.

  1. Enable IMAP
  2. Allow less secure app
  3. Review suspicious activity and mark 'That's me' to allow communication.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .