首页 > 系统相关 >linux shell 用curl 发邮件

linux shell 用curl 发邮件

时间:2023-01-06 14:46:19浏览次数:62  
标签:shell -- echo somefile linux mail curl txt com

echo "From: someone1 <[email protected]" > somefile.txt
echo "To: someone2 <[email protected]>; someone3 <[email protected]>;" >> somefile.txt
echo "Subject: sometitle" >> somefile.txt
echo "" >> somefile.txt
echo "content" >> somefile.txt
  1. 以上信息内容可以瞎写
  2. echo "" >> mail.txt 空行后才能加正文
curl --ssl-reqd  --url smtps://smtp.exmail.qq.com:465    --user [email protected]:password  --mail-from [email protected]  --mail-rcpt [email protected]  --upload-file somefile.txt
curl --ssl-reqd  --url smtps://smtp.exmail.qq.com:465    --user [email protected]:password  --mail-from [email protected]  --mail-rcpt [email protected]  --mail-rcpt [email protected]  --upload-file somefile.txt
  1. smtps服务器为腾讯企业邮箱
  2. 密码passwd为腾讯企业邮箱授权密码,参考:https://zhuanlan.zhihu.com/p/340376585
  3. somefile.txt 内容用echo "内容">> somefile.txt生成,用vim编辑不行
  4. --mail-from 值为真实邮箱地址
  5. 多个收件人就多写一次 --mail-rcpt [email protected],正文“Frome:”可以缺省对应,会不提示具体收件人someone3

标签:shell,--,echo,somefile,linux,mail,curl,txt,com
From: https://www.cnblogs.com/yiminlin/p/17030412.html

相关文章

  • linux 下根据服务名称杀死进程
     ps-ef|grepquery_test.sh|grep-vgrep#查看进程是否存在ps-ef|grepquery_test.sh|grep-vgrep|awk'{print$2}'|xargskill-9 ......
  • linux进程后台运行及输出重定向
    linux启动后,会默认打开3个文件描述符,0表示标准输入,1表示正确输出,2表示错误输出。nohuppingwww.baidu.com1>result.out2>result.out&#将正确输出和错误输出均写入re......
  • Linux-Windows-Mac-RabbitMQ安装教程
    本说明分一下三种方式安装,请根据具体环境选择相关版本。linux服务器安装win版服务器安装mac版安装linux服务器rabbitmq安装1、RabbitMQ是基于Erlang的,所以首先必须配置Erlan......
  • 批量扫描文件里的链接是否404(包含curl与get_header实现方式)
    <?php//functionchkurl($url){//$handle=curl_init($url);//curl_setopt($handle,CURLOPT_RETURNTRANSFER,TRUE);//curl_setopt($handle,CURLOPT_CON......
  • Linux/Centos: No such file or directory原因及解决办法总结
    最近想用虚拟机再复习一下Linux命令,装的是CentOS8。今天最开始是想要在terminal中修改一个文件的内容。遇到的第一个问题是我不知道怎么看这个文件的目录路径。解决:如果......
  • Linux提权之SUID提权
    概念SUID是一种对二进制程序进行设置的特殊权限,可以让二进制程序的执行者临时拥有属主的权限若是对一些特殊命令设置了SUID,那么就会有被提权的风险,常用的SUID提权命令有......
  • shell条件语句
    返回值$?=0$!上一次后台运行程序的pid[root@localhost~]#evalpingwww.baidu.com-c3;cd/etc/Unsetxing单分支if判断条件;then条件为真的分支代码fi......
  • Linux端口映射是什么?如何进行端口映射?
    百度百科中解释说:端口映射是NAT的一种,功能是把在公网的地址转翻译成私有地址,采用路由方式的ADSL宽带路由器拥有一个动态或固定的公网IP,ADSL直接接在HUB或交换机上,所有的......
  • Arch Linux安装笔记
    ​ 最近有些厌倦Windows,所以想尝试一下Linux,选择Arch的原因不再赘述,建议以ArchLinux官方安装指南为主,这篇笔记只是方便我自己安装而写的,仅供参考。1.安装前的准备1.1腾......
  • Linux - Makefile
    1.make工具简介make工具是一个根据makefile文件内容,针对目标(可执行文件)进行依赖性检测(要生成该可执行文件之前要有哪些中间文件)并执行相关动作(编译等)的工具。而这个make......