新聞中心
本篇文章給大家分享的是有關(guān)sendEmail-參數(shù)的示例分析,小編覺得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說(shuō),跟著小編一起來(lái)看看吧。
讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:主機(jī)域名、網(wǎng)站空間、營(yíng)銷軟件、網(wǎng)站建設(shè)、永城網(wǎng)站維護(hù)、網(wǎng)站推廣。
還在為L(zhǎng)inux下沒有便捷的郵件程序苦惱,還在為復(fù)雜的郵件服務(wù)器架設(shè)Google N多網(wǎng)頁(yè)? 對(duì)于小型,便捷的Linux下命令行郵件程序,sendEmail使得這一切變得輕松可行。一起來(lái)看看吧。
點(diǎn)擊(此處)折疊或打開
[python] view plain copy print?
一、sendEmail介紹
SendEmail is a lightweight, command line SMTP email client. If you have the need to send email from a command line, this
free program is perfect: simple to use and feature rich. It was designed to be used in bash scripts, batch files, Perl
programs and web sites, but is quite adaptable and will likely meet your requirements. SendEmail is written in Perl and is
unique in that it requires NO MODULES. It has an intuitive and flexible set of command-line options, making it very easy to
learn and use.
SendEmail is licensed under the GNU GPL, either version 2 of the License or (at your option) any later version.
[Supported Platforms: Linux, BSD, OS X, Windows 98, Windows NT, Windows 2000, & Windows XP]
總的來(lái)說(shuō)sendEmail簡(jiǎn)單,輕量級(jí),命令行,可伸縮,跨平臺(tái)。
二、下載與安裝
下面的地址是sendEmail的下載及詳細(xì)說(shuō)明
http://caspian.dotconf.net/menu/Software/SendEmail/
下面是安裝描述,總共四個(gè)步驟就搞定。
------------------
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
三、用法
直接輸入sendEmail,將出現(xiàn)該工具的用法介紹,如下所示。由于用法也簡(jiǎn)單明了,因此不一一解釋
robin@SZDB:~/dba_scripts/sendEmail-v1.56> ./sendEmail
sendEmail-1.56 by Brandon Zehm
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=
-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=
-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
查看詳細(xì)的幫助文件,如下方式:
./sendEmail --help addressing
./sendEmail --help message
四、示例
#發(fā)送者使用任意的郵箱方式發(fā)送郵件
robin@SZDB:~> sendEmail -f robinson@oracle.com \
> -t robinson.cheng@trade.com \
> -u "Test Mail" \
> -m "This is a test mail from Robinson"
Dec 18 14:10:23 szdb sendEmail[18494]: Email was sent successfully!
#發(fā)送者使用一個(gè)真實(shí)存在的互聯(lián)網(wǎng)郵件服務(wù)器來(lái)發(fā)送郵件
robin@SZDB:~> sendEmail -f rocket010824@163.com \
> -t robinson.cheng@trade.com \
> -u "Test Mail" \
> -s smtp.163.com \
> -xu jackson \
> -xp temp_000 \
> -m "This is test mail from Robinson"
Dec 18 14:13:24 szdb sendEmail[18500]: Email was sent successfully!
發(fā)送給多個(gè)郵件接收人
robin@SZDB:~> sendEmail -f robinson@oracle.com \
> -t "Robinson cheng
" jackson@163.com \ > -u "Send email to mutiple people" \
> -m "This is a test mail"
Dec 18 14:24:57 szdb sendEmail[18537]: Email was sent successfully!
使用抄送,密送接收人
robin@SZDB:~> sendEmail -f robinson@oracle.com \
> -t "Robinson cheng
" \ > -cc jason.wu@trade.com \
> -bcc jackson@163.com \
> -u "Test mail " \
> -m "This is a test mail"
發(fā)送帶有附件的郵件
robin@SZDB:~> sendEmail -f robinson@oracle.com \
> -t "Robinson cheng
" \ > -cc jason.wu@trade.com \
> -u "Test mail with multi attached" \
> -m "This is a test mail with multi attached" \
> -a /users/robin/addmrpt_1_11584_11649.txt "/users/robin/Temp log"
Dec 18 14:43:35 szdb sendEmail[18664]: Email was sent successfully!
#使用文件內(nèi)容作為郵件的body
robin@SZDB:~> sendEmail -f robinson@oracle.com \
> -t "Robinson cheng
" \ > -u "Test mail and the body from file contents" \
> -o message-file=/users/robin/addmrpt_1_11584_11649.txt
Dec 18 14:50:39 szdb sendEmail[18715]: Email was sent successfully!
robin@SZDB:~> cat addmrpt_1_11584_11649.txt | sendEmail -f robinson@oracle.com \
> -t "Robinson cheng
" \ > -u "Test mail and the body from file contents"
Reading message body from STDIN because the '-m
以上就是sendEmail-參數(shù)的示例分析,小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見到或用到的。希望你能通過(guò)這篇文章學(xué)到更多知識(shí)。更多詳情敬請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
網(wǎng)頁(yè)標(biāo)題:sendEmail-參數(shù)的示例分析
URL鏈接:http://fisionsoft.com.cn/article/pigpgc.html