【工具】轻量级 linux 命令行发邮件工具--SendEmail

http://caspian.dotconf.net/menu/Software/SendEmail/


An Email Program for Sending SMTP Mail from a Command Line

About 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] 

Command Line Options
SendEmail has the following command line options:
sendEmail command line options

How do I install it?
Simply download, extract, and run "sendEmail" from a command prompt, it will give a usage summary. It is written in Perl, so no compilation needed. On a unix system if your perl binary is not installed at /usr/bin/perl you may need to edit the first line of the script. If you're running a Microsoft OS you may need to put a .pl extension on sendEmail so Windows will know to associate it with perl.

TLS Support
Starting with sendEmail v1.54, TLS support is included! To enable TLS support simply install the Net::SSLeay andIO::Socket::SSL perl modules. The following new command line parameters are now available:
    -o tls=auto This is the default, TLS will be used if possible.
    -o tls=yes Use this to require TLS for message delivery.
    -o tls=no Use this to disable TLS support.
If TLS is giving strange errors, try upgrading the Net::SSLeay and IO::Socket::SSL perl modules. Please do NOT report TLS bugs unless you have already done this! If you're running up-to-date versions of these modules and you are getting TLS errors, your detailed bug report will be appreciated. Yes, you can finally use SendEmail to send messages to your GMail account :)

Frequently Asked Questions
Q: How do I send email through GMail (Google Mail) servers?
A: Just use port 587 and TLS. Example:
sendEmail -o tls=yes -f YourEmail@gmail.com -t SomeoneYoureEmailing@domain.com -s smtp.gmail.com:587 -xu YourEmail@gmail.com -xp YOURPASSWORD -u "Hello from sendEmail" -m "How are you? I'm testing sendEmail from the command line." 

Q: I get the error "invalid SSL_version specified at /System/Library/Perl/Extras/5.16/IO/Socket/SSL.pm line 332.“ on my Apple. What do I do?
A: Here's what I got from one user. It's a workaround until I put a real fix in:
> Fixed it by using Perl v5.12 that's still on OSX Mavericks. > (just changed sendEmail line 1 from #!/usr/bin/perl -w to #!/usr/bin/perl5.12 -w)

Q: Can I use non-ascii characters, like é, in an email message body?
A: It's been reported that adding the command-line parameter -o message-charset=utf-8 solves this issue.

Q: I'm using the Windows version of sendEmail and I can't seem to send a message larger than 16kb.
A: This is a known issue. I believe it's an issue with the ActiveState Perl compiler, and I don't know of a work-around.

Q: I'm using the Windows version of sendEmail, and I get the error message "the ordinal 2586 could not be located in the dynamic link libraby LIBEAY32.dll", what do I do?
A: I don't know why this happens, but you can fix it by downloading the "No TLS Support" version of sendEmail. You won't be able to send email through an SMTP server that requires encryption, but it won't give you that error message.

Why not use sendmail?
Sendmail is a large and complex mail server. Installing this kind of mail software on servers (unless it's a mail server) is more of a security risk than it's worth. Not to mention it can be a real pain messing with configuration files and such. Systems need another simpler way to send email from the command prompt, and sendEmail provides this functionality. Its a simple, direct way to send email without the overhead of other conventional email software.

How can I send anonymous email?
SendEmail was not intended to be used for malicious purposes, like sending spam! However, there are often legitimate reasons to send email anonymously. I use the term "anonymous" to mean sending email from an address that isn't normally associated with just you. For example, sendEmail is a great script for emailing company newsletters where you want to send email from an "anonymous" account like newsletter@yourdomain.com.
To send "anonymous" email from a CLI with sendEmail, simply specify a from address that you want to use with the -f option, and unless your ISP's SMTP email server is picky, it will accept and deliver it.
View Example



  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Linux中使用git send-email发送源代码和补丁需要先进行一些配置和设置。以下是一些可能出现问题的原因和解决方法: 1. 缺少sendmail或者类似的邮件发送软件 - 可以使用以下命令安装sendmail: ``` sudo apt-get install sendmail ``` 2. 没有配置邮件发送的SMTP服务器 - 可以使用以下命令设置SMTP服务器: ``` git config --global sendemail.smtpserver smtp.gmail.com git config --global sendemail.smtpserverport 587 git config --global sendemail.smtpencryption tls git config --global sendemail.smtpuser your_email@gmail.com git config --global sendemail.smtpserveraddress smtp.gmail.com git config --global sendemail.smtpserverport 587 git config --global sendemail.smtpencryption tls git config --global sendemail.smtpuser your_email@gmail.com git config --global sendemail.smtpserveraddress smtp.gmail.com git config --global sendemail.smtpserverport 587 git config --global sendemail.smtpencryption tls git config --global sendemail.smtpuser your_email@gmail.com ``` 3. 邮件发送被拒绝 - 有些邮件服务提供商可能会拒绝来自未知应用程序的邮件发送请求。此时可以尝试启用SMTP验证和应用程序密码,或者使用另一个邮件服务提供商。 4. 文件太大 - 如果要发送的文件太大,可能会被邮件服务器拒绝。可以尝试使用压缩文件或者分割文件。 总之,使用git send-email发送邮件需要对邮件服务器和git进行一些配置和设置。如果遇到问题,可以仔细查看错误提示并尝试解决。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值