# linux send email with smtp **Repository Path**: ShiWeiKJ/linux-send-email-with-smtp ## Basic Information - **Project Name**: linux send email with smtp - **Description**: 树莓派,通过命令行发送邮件,需要安装:mutt,msmtp,这是一个shell脚本,实现了自动化安装以上2个组建,配置环境,测试发送邮件 - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2022-02-10 - **Last Updated**: 2022-02-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # raspberry_send_email_with_cmd #### 介绍 树莓派,通过命令行发送邮件,需要安装:mutt,msmtp,这是一个shell脚本,实现了自动化安装以上2个组建,配置环境,测试发送邮件 #### 软件架构 软件架构说明,此脚本只能用在ubuntu,debian平台上,可以通过apt-get install安装依赖的mutt,msmtp软件包,但是如果你在其他linux平台,此脚本可以复用部分 #### 安装教程 1. apt-get install mutt msmtp 2. 配置~/.muttrc,~/.msmtprc文件 3. 其中~/.muttrc文件内容 ``` set sendmail='/usr/bin/msmtp' set use_from=yes set realname='hujiangshui' set from=799423779@qq.com set envelope_from=yes ``` --- ~/.msmtprc文件内容 ``` host smtp.qq.com from 799423779@qq.com auth plain user 799423779@qq.com password qq邮箱授权码 logfile ~/msmtp.log ``` --- 4. qq邮箱授权码获取方法 --- **qq邮箱-点击设置** ![qq邮箱-点击设置](https://images.gitee.com/uploads/images/2019/0421/215939_70e03e94_6165.png "1.png") --- **点击-账户** ![点击-账户](https://images.gitee.com/uploads/images/2019/0421/220011_6cf6d4f3_6165.png "2.png") --- **发送-配置邮件客户端-到1069 0700 69-会生成授权码-开启** ![发送-配置邮件客户端-到1069 0700 69-会生成授权码-开启](https://images.gitee.com/uploads/images/2019/0421/220034_2b53216a_6165.png "3.png") #### 使用说明 1. dos2unix init_send_email_env.sh 2. chmod 777 init_send_email_env.sh 3. ./init_send_email_env.sh直接运行 #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 码云特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)