sendmail 发送html 的邮件

限时加码!20+主流AI编程工具免费用 购周边加赠Coding Plan Lite,Claude Code、Cursor等即刻畅享,学习进阶更高效! 阅读详情

1. 启动sendmail 的进程

sudo /etc/init.d/sendmail start
ps aux|grep sendmail

2. 组装html的文件

Subject: title-testing
From: zengtai.csm@xxx.com
To: zengtai.csm@xxx.com
Cc: zengtai.csm@xxx.com
MIME-VERSION: 1.0
Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw"

--GvXjxJ+pjyke8COw
Content-type: text/html; charset=gb2312  #设置编码后中文还是乱码
Content-Transfer-Encoding: 7bit

<html>
<body>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="black">
<tr>
    <th bgcolor="#66ffff">data table name</th>
    <th bgcolor="#66ffff">data table size</th>
    <th bgcolor="#66ffff">data table time</th>
</tr>
<tr>
    <th bgcolor="white">data_index</th>
    <th bgcolor="white">2048M</th>
    <th bgcolor="white">20150806</th>
</tr>
</table>
</body>
</html>


3. sendmail 发送命令

cat t.txt|sendmail -t -F zengtai.csm@xxx.com

4. python 用smtplib 发送邮件, smtp_server"127.0.0.1"

但是发布出去,那首先要看看看此台机器是否启动了smtp的服务,也就是25端口是否是okd 
netstat -lan|grep 25
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN

5. sendmail 的smtp的服务配置文件
rpm -qf /etc/init.d/sendmail
sendmail-8.13.8-8.1.rpm

/etc/mail/sendmail.mc



linux中的sendmail发送邮件 linux下的sendmail发送邮件 阅读详情

相关推荐

CentOS系统中使用sendmail

如果你的邮件服务器需要认证(如SMTP认证),你可能需要在sendmail的配置中设置认证信息。安装完成后,你可以通过编辑/etc/mail/sendmail.mc文件来配置sendmail。在CentOS系统中,如果你想要使用sendmail发送电子邮件,你可以通过以下步骤来配置和测试它。在配置完成后,你可以通过发送一个测试邮件来验证sendmail是否正确配置。确保你的邮件服务器(如mail.example.com)是可访问的,并且你的IP地址没有被列入黑名单。步骤3:测试sendmail配置。

qq_34068440的博客 1042

linux sendmail 发送邮件

目录 一、安装sendmail与mail 二、发送邮件 三、设置发件人信息 一、安装sendmail与mail 1、安装sendmail: 1) centos下可以安装命令: yum -y install sendmail 2) 安装完后启动sendmail命令: service sendmail start 2、安装mail 安装命令: yum install -y mailx 二、发送邮件 1、通过文件内容发送 发送命令: mail -s 'mail tes

whatday的专栏 3498

利用sendmail命令发送html格式邮件

如何利用sendmail命令发送html格式邮件

在 linux 上使用 sendmail 发送邮件

如何在 linux 上使用 sendmail 发送邮件

choumin的专栏 3349

在CentOS 上使用Sendmail邮件

如果你运行了一个web服务器或者一台VPS ,你可能需要在你的PHP程序中发送邮件;同样,如果你正在运行一个WordPress博客,或者你正在使用任何类型的CMS,你允许你的访问者通过联系表单向你发送电子邮件(例如使用WordPress的Contact Form 7插件),你可能需要安装一个名为sendmail 的简单的程序到你的web服务器上。在服务器上安装 sendmail 完成后,你可以允许你的用户通过联系栏通过邮件联系你了。7中安装sendmail ,运行下面的。使用这个命令进入php交互。

markzhy的博客 552

sendmail发送html邮件

有时候工作需要发送一些html格式的邮件,搞来搞去,用sendmail命令发送出去的就只是文本邮件。起初还以为不行了,经过研究,原来sendmail还可以这样用的,如下: cat$mail_file|formail-I"From:iscsi@xxx.com"-I"To:$mailto"-I"MIME-Version:1.0"-I"Content...

weixin_33781606的博客 318

sendmail发送html邮件,如何发送与bash命令“sendmail的”一个HTML电子邮件?(How to send a ht...

任何人有一个试用?Sendmail的据说是不可扩展,但它是免费的,所以我决定先用它现在:)Answer 1:我不能让任何发布的解决方案的工作,但最后发现这在其他地方,和它的伟大工程:(echo "From: ${from}";echo "To: ${to}";echo "Subject: ${subject}";echo "Content-Type: text/html";echo "MIME-V...

weixin_35671798的博客 410

Sendmail 发送带附件的 html 邮件

sendmail 是 linux 上的一个基础的 mail 软件。 通常情况

勇敢向前冲 4258

sendmail发送HTML格式的邮件(转)

sendmail发送HTML格式的邮件(转)[@more@]先将来自HTML页面的数据解码,再调用unix系统sendmail命令即可。例如下:#!/usr/local/bin/perl#&readparse;prin...

congjukun0600的博客 417

sendmail发送html邮件,如何使用bash命令“sendmail发送html电子邮件

8 个答案:答案 0 :(得分:38)我无法获得任何已发布的解决方案,但最终在其他地方找到了它,并且效果很好:(echo "From: ${from}";echo "To: ${to}";echo "Subject: ${subject}";echo "Content-Type: text/html";echo "MIME-Version: 1.0";echo "";echo "${message...

weixin_33462540的博客 496

sendmail发送html邮件,尝试使用sendmail发送/发送html电子邮件,但显示电子邮件的源代码...

我试图在PHP中发送HTML电子邮件,但它始终显示电子邮件程序中电子邮件的源代码。但它应该将html电子邮件呈现为html,而不是将源代码显示为电子邮件内容。尝试使用sendmail发送/发送html电子邮件,但显示电子邮件的源代码我把我的邮件是这样的:$fd = popen("/var/qmail/bin/sendmail -t","w") or die("Couldn't Open Sendm...

weixin_31642733的博客 432

LINUX sendmail 发送HTML 邮件

linux mail命令不能指邮件头所以使用formail命令 cat htmlmail |formail -I "From: aaa@aaa.com" -I "MIME-Version:1.0" -I "Content-type:text/html;charset=gb2312" -I "Subject:test"|/usr/sbin/sendmail -oi ghb@1...

weixin_34334744的博客 347

Linux环境下sendmail发送html格式正文及csv格式附件邮件

Linux环境下sendmail发送html格式正文及csv格式附件邮件 mail_receiver.cc中每行存一个收件人邮箱地址。 关键在于使用echo 'Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw"' 将邮件内容分段。 Content-Type: text/html; html页面Content-Type:

Moxiao__墨箫 4997

formail 发送HTML 邮件通过 SENDMAIL

cat a.html | formail -I "Content-type:text/html;charset=utf-8" -I "Subject:layer4 config monitor" | /usr/sbin/sendmail ar_88@qq.com

weixin_33813128的博客 177

perl sendmail发送带附件的html邮件

最近要写个perl脚本发送带附件的html格式的邮件,要求从csv中读取发件人,收件人,以及邮件html body中的变化部分,好久没写perl脚本,有点吃力了。。:) #!/usr/local/bin/perl -w use strict; use warnings; if($#ARGV != 0){ die "Usage: $0 "; } # static properties

thejtechs的专栏 1352

shell sendmail发送带附件的html格式邮件

哎,今天一直在找怎么发送带附件的有是html格式的邮件.如果只是html格式或者只是带附件的都好弄,但是这两个都要弄的话还是很费时间.但是,终于在一篇好帖的帮助下弄出来了. http://www.zedwood.com/article/bash-send-mail-with-an-attachment帖子只把做法贴出来了,里面有的评论对做法做了大致的讲解.当然了,不仅仅支持html和excel,还

w20175357的专栏 3985

Perl 发送邮件

如果你的程序在 Linux/Unix 系统上运行,你就可以在 Perl 中使用工具来发送邮件

Kandy1iu的博客 2405

BASH - 使用sendmail发送邮件

发送文本邮件 /usr/sbin/sendmail -t -F SenderDisplayerName &lt;&lt;EOF SUBJECT: sendmail test subject TO: to_mail_address CC: cc_mail_addres MIME-VERSION: 1.0 Content-type: text/plain mail content...

寂静湖畔 944
上一篇: 系统的稳定性
下一篇: 容量预估、压测过程中总结
caoshuming_500
博客等级 码龄18年 202粉丝 238原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值