Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2119531
  • 博文数量: 195
  • 博客积分: 4378
  • 博客等级: 上校
  • 技术积分: 4046
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-09 11:37
个人简介

白天和黑夜只交替没交换无法想像对方的世界

文章分类

全部博文(195)

文章存档

2014年(3)

2013年(20)

2012年(18)

2011年(107)

2010年(17)

2009年(5)

2008年(20)

2007年(5)

分类: Python/Ruby

2011-08-19 23:46:52

 

命令行及脚本发送邮件测试的方法:

 

方法一:

[root@dg01 ~]#  telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 dg01.com.cn ESMTP Sendmail 8.13.8/8.13.8; Fri, 19 Aug 2011 06:53:38 -0400
helo demo.domain.tld
250 dg01.com.cn Hello localhost.localdomain [127.0.0.1], pleased to meet you
mail from:
250 2.1.0 ... Sender ok
rcpt to:<>
250 2.1.5 <>... Recipient ok
data
354 Enter mail, end with "." on a line by itself
----------------------------------

This is the mail test content

----------------------------------

----------------------------------

This is the mail test content

----------------------------------
.
250 2.0.0 p7JArcEE018377 Message accepted for delivery

quit

 

方法二:

脚本测试
[root@dg01 ~]# cat mtest.sh
#!/bin/bash
/usr/sbin/sendmail -t <From: Mail testing           
TO:kevin@126.com

Cc:root@dg01.com.cn
Bcc:kevin@hotmail.com
subject:mail testing
----------------------------------

This is the mail test content

----------------------------------

----------------------------------

This is the mail test content

----------------------------------

EOF

阅读(3495) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~