Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to send a email. Here my working example on ubuntu:

sendEmail -f <FROM_EMAIL> -t <TO_EMAIL> -u 'Book' -m 'ISBN: 12345-678-90' -s smtp.gmail.com -o message-charset=utf8 -o tls=yes -xu <USERNAME> -xp <PASSWORD>

On the raspberry i get an error:

invalid SSL_version specified at /usr/local/share/perl/5.14.2/IO/Socket/SSL.pm line 332

I have no idea, what ist wrong. Has anyone an idea, how to solve the problem? Alternarive - an replacement for the sendEmail without own smtp server?

share|improve this question
What distro are you using and is it up to date? – Jivings Oct 7 '12 at 13:07
I'm using the raspbian wheezy and yes - it is up to date. – cupakob Oct 7 '12 at 13:14

The bug appears to be in line 1490 of /usr/local/share/perl/5.14.2/IO/Socket/SSL.pm.

The SSL_version is being coded as "SSLv3 TLSv1" and the regular expression is failing.

I hacked it as a workaround as follows...





That did the trick for me.

share|improve this answer
nice, i must try it :) – cupakob Nov 12 '12 at 20:26
works, but i've used the /usr/share/perl5/IO/Socket/SSL.pm. Thanks a lot... – cupakob Nov 13 '12 at 16:39
up vote 4 down vote accepted

...it seems to be a bug in Debian:


and here replacement for sendEmail:


Now i can send email with this command:

smtp-cli --verbose --host smtp.gmail.com --user <USER> --auth-plain --from <FROM_EMAIL> --to <TO_EMAIL> --pass <PASSWORD> --subject "Test" --body-plain "Log files are attached."

smtp-cli --verbose --host smtp.gmail.com --user abcde --auth-plain --from abcde@gmail.com --to fggga@gmail.com --pass topSecret --subject "Test" --body-plain "Log files are attached."
share|improve this answer
This worked like a charm. I should note that I had this problem on an x64 ubuntu 15.04, so it looks like nobody is going to fix the Perl bug ... – mhvelplund Aug 14 '15 at 13:20

After installing sendemail on Raspberry pi, there will be an error

"No TLS support!".

To fix it, install tls packages:

sudo apt-get install libnet-ssleay-perl libio-socket-ssl-perl


sudo apt-get install libio-socket-ssl-perl libnet-ssleay-perl

Then after running "sendemail", we will get the error

"invalid SSL_version specified at /usr/local/share/perl/5.14.2/IO/Socket/SSL.pm line 332"

Method below works:

sudo nano usr/share/perl5/IO/Socket/SSL.pm

then change

  • m{^(!?)(?:(SSL(?:v2|v3|v23|v2/3))|(TLSv1[12]?))$}i


  • m{^(!?)(?:(SSL(?:v2|v3|v23|v2/3))|(TLSv1[12]?))}i
share|improve this answer

Another reason for SSL failure is the time used for time stamping the communications. Make sure that the system time on the Pi is current.

Either run ntpd or run sudo ntpdate <some time server>. ntpd corrects the system time in small increments. if your time is off by hours, it will take days to fix it.

share|improve this answer

Thanks a lot Tom & Marius !

I've found that you have to travel to,

sudo nano usr/share/perl5/IO/Socket/SSL.pm

and replace this:


with this:


This solves it. :-)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.