Mar 272009
 

Sponsored Link

SendEmail is a lightweight, completly command line based, SMTP email agent.It was designed to be used in bash scripts, Perl programs, and web sites, but it is also quite useful in many other contexts.SendEmail is written in Perl

Install sendemail in debian lenny

#apt-get install sendemail

This will complete the installation.

If you are using Debian Etch you need to compile sendemail from source
Preparing your system

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

Download latest version from here

wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.55.tar.gz

Uncompress the .tar.gz

#tar zxvf /tmp/sendEmail-v1.55.tar.gz

#cd /tmp/sendEmail-v1.55

Copy the sendEmail script to /usr/local/bin

#cp /tmp/sendEmail-v1.55/sendEmail  /usr/local/bin

Make sure its executable

#chmod +x /usr/local/bin/sendEmail

Sendemail Examples

Simple Email Using Gmail Account

sendEmail -f [email protected] -t [email protected] \
-u this is the test tile -m "this is a test message" \
-s smtp.gmail.com \
-o tls=yes \
-xu usernameonly -xp mypasswd

“usernameonly” must not contain @gmail.com only the username.

Simple Email

sendEmail -f [email protected] \
-t [email protected] \
-s relay.isp.net \
-u "Test email" \
-m "Hi , this is a test email."

Sending to mutiple people

sendEmail -f [email protected] \
-t "admin <[email protected]>" [email protected] [email protected] \
-s relay.isp.net \
-u "Test email" \
-m "Hi this is a test email."

Sending to multiple people using cc and bcc recipients

(notice the different way we specified multiple To recipients, you can do this for cc and bcc as well)

sendEmail -f [email protected] \
-t [email protected];[email protected];[email protected] \
-cc [email protected] [email protected] [email protected] \
-bcc [email protected] [email protected] [email protected] \
-s relay.isp.net \
-u "Test email with cc and bcc recipients" \
-m "Hi his is a test email."

Sending to multiple people with multiple attachments

sendEmail -f [email protected] \
-t [email protected] \
-cc [email protected] [email protected] [email protected] \
-s relay.isp.net \
-u "Test email with cc and bcc recipients" \
-m "Hi this is a test email." \
-a /mnt/storage/document.sxw "/root/My Documents/Work Schedule.kwd"

Sending an email with the contents of a file as the message body

cat /tmp/file.txt | sendEmail -f [email protected] \
-t [email protected] \
-s relay.isp.net \
-u "Test email with contents of file"

Sending an email with the contents of a file as the message body (method 2)

sendEmail -f [email protected] \
-t [email protected] \
-s relay.isp.net \
-o message-file=/tmp/file.txt \
-u "Test email with contents of file"

Sending an html email: (make sure your html file has <html> at the beginning)

cat /tmp/file.html | sendEmail -f [email protected] \
-t [email protected] \
-s relay.isp.net \
-u "Test email with html content"

Send Short Message Service (SMS)/text message to a cellular phone

Simple Text Message Sent To Cellular Phone Using Gmail Account

./sendEmail -f [email protected] -t [email protected] \
-m This is an SMS message from Linux.\
-o tls=auto \
-s smtp.gmail.com \
-xu usernameonly -xp mypasswd

Providers

What's my SMS Email address?

AT&T [email protected]
Example: [email protected]
Cingular [email protected]
Metrocall [email protected]
Nextel [email protected]
Sprint PCS [email protected]
T-Mobile [email protected]
Verizon [email protected]
ALLTEL [email protected]

Sponsored Link

 Posted by at 12:47 am