PDA

View Full Version : [ubuntu] Using sendEmail in terminal



steve101101
April 16th, 2009, 06:11 AM
I am trying to send an email to my email account using sendEmail here is what happens though ...



steven@steven-desktop:~$ sendEmail -f mailaddress@yahoo.com -t mailaddress@yahoo.com -u test
Reading message body from STDIN because the '-m' option was not used.
If you are manually typing in a message:
- First line must be received within 60 seconds.
- End manual input with a CTRL-D on its own line.

Apr 16 01:09:45 steven-desktop sendEmail[21076]: Message input complete.
Apr 16 01:09:45 steven-desktop sendEmail[21076]: ERROR => Connection attempt to localhost:25 failed: IO::Socket::INET: connect: Connection refused
steven@steven-desktop:~$

HermanAB
April 16th, 2009, 06:48 AM
OK, sendEmail seems similar to nullmailer and is a very simple mail forwarding agent.

It seems to be telling exactly what the problem is though. Add the -m and the (quoted) message before pressing Enter.


$ sendEmail -f mailaddress@yahoo.com -t mailaddress@yahoo.com -u test -m "The message body"

and maybe that will work?

The next problem seems to suggest that sendEmail is in fact NOT a complete MTA and may require to install nullmailer or postfix to actually send the message:

ERROR => Connection attempt to localhost:25 failed: IO::Socket::INET: connect: Connection refused


You got to read the documentation and experiment a bit.

lovinglinux
April 16th, 2009, 07:11 AM
The next problem seems to suggest that sendEmail is in fact NOT a complete MTA and may require to install nullmailer or postfix to actually send the message:

SendEmail doesn't require postfix or another MTA, it only requires a working smtp account on any e-mail provider. If you need to use Gmail or Yahoo Mail accounts, the you could try installing libio-socket-ssl-perl and libnet-ssleay-perl, due to the ssl authentication method. I never tried tho, because I have an account that accept smtp on port 25 without ssl.

Here is an example of sendEmail command:


sendEmail -f username@foo.com -t destination@foo.com -cc carboncopy@foo.com -u "Message title" -m "The body of the message" -s smtp.foo.com:25 -xu username -xp password

steve101101
April 16th, 2009, 02:08 PM
thanks both of you. I installed libio-socket-ssl-perl and libnet-ssleay-perl and then used the sendEmail command and now it works. My smtp uses ssl for security and now it works perfectly. thanks.

steve101101
April 16th, 2009, 02:16 PM
Everyday I am amazed at the utter power of ubuntu and its ability to do whatever you need to do. :)

HermanAB
April 16th, 2009, 03:11 PM
Did you install sendEmail using Synaptic? If so, then the package is broken since it should automatically install those missing libraries and you should file a bug report please. If you installed it from source, then you should consider writing a little howto guide.

steve101101
April 16th, 2009, 04:33 PM
I intalled it using synaptic so i guess it is broken. however i can write a how to.

steve101101
April 16th, 2009, 07:20 PM
here is my new howto http://ubuntuforums.org/showthread.php?t=1127478