What about sendEmail
2010-05-05 14:17
330 查看
------------------
What is sendEmail?
------------------
SendEmail is a lightweight, completly command line based, SMTP email agent.
If you have the need to send email from the command line, this tool is perfect.
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
and is unique in that it requires NO SPECIAL MODULES. It has an intuitive and
flexible set of command-line options, making it very easy to learn and use.
------------------
Installation
------------------
SendEmail is a perl script/program, and only needs to be copied to a directory
in your path to make it accessible. Most likely the following steps will
be sufficient:
1) Extract the package
tar -zxvf sendEmail-v1.XX.tar.gz
2) Copy the sendEmail script to /usr/local/bin
cp -a sendEmail-v1.XX/sendEmail /usr/local/bin
3) Make sure its executable
chmod +x /usr/local/bin/sendEmail
4) Run it
sendEmail
or
/usr/local/bin/sendEmail
NOTES:
* Running sendEmail without any arguments will produce a usage summary.
* SendEmail is written in Perl, so no compilation is needed.
* On a Unix/Linux OS if your perl binary is not installed at /usr/bin/perl
you may need to edit the first line of the script accordingly.
---------------
Usage Overview
---------------
sendEmail-1.56 by Brandon Zehm <caspian@dotconf.net>
Synopsis: sendEmail -f ADDRESS [options]
Required:
-f ADDRESS from (sender) email address
* At least one recipient required via -t, -cc, or -bcc
* Message body required via -m, STDIN, or -o message-file=FILE
Common:
-t ADDRESS [ADDR ...] to email address(es)
-u SUBJECT message subject
-m MESSAGE message body
-s SERVER[:PORT] smtp mail relay, default is localhost:25
Optional:
-a FILE [FILE ...] file attachment(s)
-cc ADDRESS [ADDR ...] cc email address(es)
-bcc ADDRESS [ADDR ...] bcc email address(es)
-xu USERNAME username for SMTP authentication
-xp PASSWORD password for SMTP authentication
Paranormal:
-b BINDADDR[:PORT] local host bind address
-l LOGFILE log to the specified file
-v verbosity, use multiple times for greater effect
-q be quiet (i.e. no STDOUT output)
-o NAME=VALUE advanced options, for details try: --help misc
-o message-content-type=<auto|text|html|other>
-o message-file=FILE -o message-format=raw
-o message-header=HEADER -o message-charset=CHARSET
-o reply-to=ADDRESS -o timeout=SECONDS
-o username=USERNAME -o password=PASSWORD
-o tls=<auto|yes|no> -o fqdn=FQDN
Help:
--help the helpful overview you're reading now
--help addressing explain addressing and related options
--help message explain message body input and related options
--help networking explain -s, -b, etc
--help output explain logging and other output options
--help misc explain -o options, TLS, SMTP auth, and more
---------------
Examples
---------------
Simple Email:
sendEmail -f me@gmail.com \
-t friend@yahoo.com \
-s smtp.gmail.com:587 \
-xu me@gmail.com \
-xp MY-PASSWORD \
-u "Test email" \
-m "Hi buddy, this is a test email."
Sending to mutiple people:
sendEmail -f myaddress@isp.net \
-t "Scott Thomas <scott@isp.net>" jason@isp.net renee@isp.net \
-s relay.isp.net \
-u "Test email" \
-m "Hi guys, this is a test email."
Sending to multiple people using cc and bcc recipients:
(notice the different way I specified multiple To recipients, you can do this for cc and bcc as well)
sendEmail -f myaddress@isp.net \
-t scott@isp.net;jason@isp.net;renee@isp.net \
-cc jennifer@isp.net paul@isp.net jeremiah@isp.net \
-bcc troy@isp.net miranda@isp.net jay@isp.net \
-s relay.isp.net \
-u "Test email with cc and bcc recipients" \
-m "Hi guys, this is a test email."
Sending to multiple people with multiple attachments:
sendEmail -f myaddress@isp.net \
-t jason@isp.net \
-cc jennifer@isp.net paul@isp.net jeremiah@isp.net \
-s relay.isp.net \
-u "Test email with cc and bcc recipients" \
-m "Hi guys, 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 myaddress@isp.net \
-t jason@isp.net \
-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 myaddress@isp.net \
-t jason@isp.net \
-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 myaddress@isp.net \
-t jason@isp.net \
-s relay.isp.net \
-u "Test email with html content"
What is sendEmail?
------------------
SendEmail is a lightweight, completly command line based, SMTP email agent.
If you have the need to send email from the command line, this tool is perfect.
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
and is unique in that it requires NO SPECIAL MODULES. It has an intuitive and
flexible set of command-line options, making it very easy to learn and use.
------------------
Installation
------------------
SendEmail is a perl script/program, and only needs to be copied to a directory
in your path to make it accessible. Most likely the following steps will
be sufficient:
1) Extract the package
tar -zxvf sendEmail-v1.XX.tar.gz
2) Copy the sendEmail script to /usr/local/bin
cp -a sendEmail-v1.XX/sendEmail /usr/local/bin
3) Make sure its executable
chmod +x /usr/local/bin/sendEmail
4) Run it
sendEmail
or
/usr/local/bin/sendEmail
NOTES:
* Running sendEmail without any arguments will produce a usage summary.
* SendEmail is written in Perl, so no compilation is needed.
* On a Unix/Linux OS if your perl binary is not installed at /usr/bin/perl
you may need to edit the first line of the script accordingly.
---------------
Usage Overview
---------------
sendEmail-1.56 by Brandon Zehm <caspian@dotconf.net>
Synopsis: sendEmail -f ADDRESS [options]
Required:
-f ADDRESS from (sender) email address
* At least one recipient required via -t, -cc, or -bcc
* Message body required via -m, STDIN, or -o message-file=FILE
Common:
-t ADDRESS [ADDR ...] to email address(es)
-u SUBJECT message subject
-m MESSAGE message body
-s SERVER[:PORT] smtp mail relay, default is localhost:25
Optional:
-a FILE [FILE ...] file attachment(s)
-cc ADDRESS [ADDR ...] cc email address(es)
-bcc ADDRESS [ADDR ...] bcc email address(es)
-xu USERNAME username for SMTP authentication
-xp PASSWORD password for SMTP authentication
Paranormal:
-b BINDADDR[:PORT] local host bind address
-l LOGFILE log to the specified file
-v verbosity, use multiple times for greater effect
-q be quiet (i.e. no STDOUT output)
-o NAME=VALUE advanced options, for details try: --help misc
-o message-content-type=<auto|text|html|other>
-o message-file=FILE -o message-format=raw
-o message-header=HEADER -o message-charset=CHARSET
-o reply-to=ADDRESS -o timeout=SECONDS
-o username=USERNAME -o password=PASSWORD
-o tls=<auto|yes|no> -o fqdn=FQDN
Help:
--help the helpful overview you're reading now
--help addressing explain addressing and related options
--help message explain message body input and related options
--help networking explain -s, -b, etc
--help output explain logging and other output options
--help misc explain -o options, TLS, SMTP auth, and more
---------------
Examples
---------------
Simple Email:
sendEmail -f me@gmail.com \
-t friend@yahoo.com \
-s smtp.gmail.com:587 \
-xu me@gmail.com \
-xp MY-PASSWORD \
-u "Test email" \
-m "Hi buddy, this is a test email."
Sending to mutiple people:
sendEmail -f myaddress@isp.net \
-t "Scott Thomas <scott@isp.net>" jason@isp.net renee@isp.net \
-s relay.isp.net \
-u "Test email" \
-m "Hi guys, this is a test email."
Sending to multiple people using cc and bcc recipients:
(notice the different way I specified multiple To recipients, you can do this for cc and bcc as well)
sendEmail -f myaddress@isp.net \
-t scott@isp.net;jason@isp.net;renee@isp.net \
-cc jennifer@isp.net paul@isp.net jeremiah@isp.net \
-bcc troy@isp.net miranda@isp.net jay@isp.net \
-s relay.isp.net \
-u "Test email with cc and bcc recipients" \
-m "Hi guys, this is a test email."
Sending to multiple people with multiple attachments:
sendEmail -f myaddress@isp.net \
-t jason@isp.net \
-cc jennifer@isp.net paul@isp.net jeremiah@isp.net \
-s relay.isp.net \
-u "Test email with cc and bcc recipients" \
-m "Hi guys, 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 myaddress@isp.net \
-t jason@isp.net \
-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 myaddress@isp.net \
-t jason@isp.net \
-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 myaddress@isp.net \
-t jason@isp.net \
-s relay.isp.net \
-u "Test email with html content"
相关文章推荐
- the email title about automatic to send invoice by mail
- sendEmail.py
- fir.im sendEmail
- How to Send an Email Using UTL_SMTP with Authenticated Mail Server
- linux sendEmail工具发送邮件
- hdu 1075 What Are You Talking About ( trie + 模拟 )
- send email using esmtp by windows command window
- Save an XML File to Database and Send an Email using XSLT
- excel删除列和send email下载地址
- hdu1075 What Are You Talking About(qsort二分查找& 字典树查找)
- hdu1075 What Are You Talking About
- Sql Server Send Email...
- hdoj 1075 What Are You Talking About 【STL map+string】
- 创造应用英语环境学英语-how to send email
- What Are You Talking About
- What did I learn from the QucikStart about DAAB?
- hdu 1075 What Are You Talking About(Trie树)
- Java Mail send email
- HDU 1075 What Are You Talking About(字典树模板题)
- 发送邮件 (Send Email)