zoukankan      html  css  js  c++  java
  • centos6.5安装sendmail

    1.下载安装sendEmail(下载绿色版,解压可直接使用)

    wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz 
    tar -xzvf sendEmail-v1.56.tar.gz
    mv sendEmail-v1.56 /usr/local/
    sendemail
    ln -s /usr/local/sendemail/sendEmail /usr/sbin/sendmail

    2.发送邮件

    sendmail -f xpeka@163.com -t 3956865697@qq.com -s smtp.163.com -u "邮件主题" -o message-content-type=html -o message-charset=utf8 -xu xpeka -xp xxxx -m "邮件内容"

    命令说明:

    sendmail:邮件主程序
    -f x.peka@163.com:发件人邮箱
    -t 494865597@qq.com:收件人邮箱
    -s smtp.163.com:发件人的smtp服务器地址
    -u "邮件主题":邮件的标题
    -o message-content-type=html:邮件内容的格式,html表示它是html格式
    -o message-charset=utf8:邮件内容编码
    -xu x.peka:发件人的邮箱账号
    -xp xxxx:发件人邮箱密码
    -m "邮件内容":邮件的具体内容

    发送成功之后会有如下提示:

    [root@localhost myshell]# sendmail -f xpeka@163.com -t 3956865697@qq.com -s smtp.163.com -u lwj -o message-content-type=html -o message-charset=utf8 -xu xpeka -xp xxxx -m lzy 

    Feb
    02 17:17:30 localhost sendmail[6652]: Email was sent successfully!
    #!/bin/sh
    to=$1
    subject=$2
    body=$3
    sendemail -f x.peke@163.com -t "$to" -s smtp.163.com -u "$subject" -o message-content-type=html -o message-charset=utf8 -xu x.peka -xp l123456 -m "$body" >>/tmp/sendemail.log
  • 相关阅读:
    [LeetCode] 39. Combination Sum 组合之和
    CSS3
    常见中文字体在CSS中的Unicode编码(宋体:5B8B4F53)
    List<Object> 使用Linq
    查看工作流详情页面
    java程序调用.net接口服务地址的写法
    C# Repeater 嵌套
    JavaScript刷新页面,不重复提交
    Migration-添加表(加外键)
    Migration-添加表
  • 原文地址:https://www.cnblogs.com/vijayfly/p/5178134.html
Copyright © 2011-2022 走看看