<?php
use PHPMailer\PHPMailer\PHPMailer;
require '../vendor/autoload.php'; $mail = new PHPMailer(true); try {
//Server settings
$mail->CharSet = 'utf-8';
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = 'ssl://smtp.mxhichina.com'; //使用阿里云注意使用ssl协议
$mail->SMTPAuth = true;
$mail->Username = 'xxx';
$mail->Password = 'xxx';
$mail->SMTPSecure = 'tls';
$mail->Port = 465; //阿里云开启端口 //Recipients
$mail->setFrom('xxx', 'xxxxxx');
$mail->addAddress('xxx', 'Joe User');
$mail->addAddress('xxx', 'Joe User');
$mail->addReplyTo('xxx', 'Information'); $mail->isHTML(true);
$mail->Subject = '阿里企业邮箱发送自动发送邮件';
$mail->Body = '<b>报警了....</b>';
$mail->AltBody = '报警邮件'; $mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}

最新文章

  1. ubuntu下使用visual studio code来编译和调试C++
  2. 在Py文件中引入django环境
  3. Android--Retrofit的简单使用(一)
  4. openstack排错
  5. Winsock完成端口模型-Delphi代码
  6. web版扫雷小游戏(四)
  7. 在CheckBox中,仅仅允许选择一项
  8. Mojo 分析日志接口
  9. Java中IO流
  10. 游戏音频技术备忘 (三) 集成Wwise到Unreal Engine
  11. 09 ListView监听 ExpandableListView的使用总结
  12. SQL Server 中如何做到连续时间段的拆分?
  13. UVA 10618 Tango Tango Insurrection
  14. ubuntu 下redis的安装简介
  15. maven 配置文件settings.xml设置
  16. [leetcode]28. Implement strStr()实现strStr()
  17. boost asio 学习(一)io_service的基础
  18. 【12月26日】A股滚动市盈率PE最低排名
  19. Ubuntu系统查看mongo得慢日志,及一些操作
  20. 给tabBarItem加点击效果动画

热门文章

  1. code first迁移(add-migration)的时候 后面信息不能有中文 中文报错 &quot;不支持给定路径的格式。&quot;
  2. Android开发 ----------怎样真机调试?
  3. qt的应用层主要是大型3d,vr,管理软件和器械嵌入软件(有上千个下一代软件黑科技项目是qt的,美国宇航局,欧洲宇航局,超级战舰DDG1000)
  4. 实用的 Matlab
  5. WPF:将Office文档、任意类型文件嵌入到EXE可执行文件中
  6. .net元数据
  7. [bug系列]Method not found: &#39;Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommandBuilderFactory
  8. JS 中按键处理
  9. c#定时调用作业
  10. Z-Order