Helpers\PHPMailer

PHPMailer is a third party class for sending emails, Full docs are available athttps://github.com/Synchro/PHPMailer

Make an alias:

use Helpers\PhpMailer\Mail;

To use PHPMailer create a new instance of it:

$mail = new Mail();

Once an instance has been created all the properties are available to you, a typical example:

$mail = new Mail();
$mail->setFrom('noreply@domain.com');
$mail->addAddress('user@domain.com');
$mail->subject('Important Email');
$mail->body("<h1>Hey</h1><p>I like this <b>Bold</b> Text!</p>");
$mail->send();

To use gmail use at your own risk!! You must enable an option in order to allow to send email through gmail goto https://myaccount.google.com/security#connectedapps login and enable Allow access to less secure apps.

The class has the ability to send via SMTP in order to do so edit Helpers/PhpMailer/Mail.php and enter your SMTP settings you can also set a default email from address so you don't have to supply it each time:

public $From     = 'noreply@domain.com';
public $FromName = SITETITLE;
public $Host = 'smtp.gmail.com';
public $Mailer = 'smtp';
public $SMTPAuth = true;
public $Username = 'email@domain.com';
public $Password = 'password';
public $SMTPSecure = 'tls';
public $WordWrap = 75;

You don't need to specify a plain text version of the email to be sent out, this is done automatically from the supplied body.

Helpers\PHPMailer的更多相关文章

  1. Helpers Overview

    Helpers Overview Helpers are classes that are not part of the core system but can greatly improve it ...

  2. # PHP - 使用PHPMailer发邮件

    PHPMailer支持多种邮件发送方式,使用起来非常简单 1.下载PHPMailer https://github.com/PHPMailer/PHPMailer,下载完成加压后, 把下边的两个文件复 ...

  3. ASP.NET Core 中文文档 第四章 MVC(3.6.1 )Tag Helpers 介绍

    原文:Introduction to Tag Helpers 作者:Rick Anderson 翻译:刘浩杨 校对:高嵩(Jack) 什么是 Tag Helpers? Tag Helpers 提供了什 ...

  4. ASP.NET Core 中文文档 第四章 MVC(3.6.2 )自定义标签辅助类(Tag Helpers)

    原文:Authoring Tag Helpers 作者:Rick Anderson 翻译:张海龙(jiechen) 校对:许登洋(Seay) 示例代码查看与下载 从 Tag Helper 讲起 本篇教 ...

  5. PHPmailer关于Extension missing: openssl报错的解决

    最近在写一个网页的时候,需要用到PHPmailer来发送邮件,按照官网上给出的demo写出一个例子,却报错Extension missing: openssl 最后发现需要修改php.ini中的配置: ...

  6. [asp.net core]定义Tag Helpers

    原文地址 https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/authoring Getting started wi ...

  7. [asp.net core] Tag Helpers 简介(转)

    原文地址 https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/intro What are Tag Helpers? ...

  8. 【夯实PHP基础】PHP发送邮件(PHPMailer)

    本文地址 参考地址 分享提纲: 1. 概述 2. 编写代码发送邮件 3. 参考文档 1. 概述 本文是讲利用邮件类库 PHPMailer来发送邮件方法. 我们在做project的时候常常需要邮件的功能 ...

  9. 使用PHPMailer发送邮件

    如果要使用php发送邮件,则可以使用PHP 内置的mail() 函数,但是mail()函数需要有服务器支持 必须有自己的邮件服务器,如果使用stmp服务来发送邮件的话相当于代替别人发送,而不是从自己服 ...

随机推荐

  1. hive UDAF

    java 程序 package com.ibeifeng.udaf; import org.apache.hadoop.hive.ql.exec.UDAF; import org.apache.had ...

  2. 配置RHadoop与运行WordCount例子

    1.安装R语言环境 su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch. ...

  3. 【转】Maven实战(一)---Maven Build--缺少Jar包

    原博文出于: http://blog.csdn.net/liutengteng130/article/details/41426955   感谢! 新建的Maven项目,在build的时候总是打包失败 ...

  4. 值栈与ognl

    ValueStack (值栈): 1.贯穿整个Action的生命周期(每个Action类的对象实例都拥有一个ValueStack对象).相当于一个数据的中转站.在其中保存当前Action对象和其他相关 ...

  5. 问题-XE8报Object factory for class{xx-xx-xx-xx-xx} is missing. To register it, you can drop component[TFDGUIxWaitCursor] into your project.

    问题现象:XE8开发数据访问程序时放入了FDPhysMSSQLDriverLink1.FDConnection1.FDConnection1.FDQuery1.DBGrid1,设计期没法,运行期报&q ...

  6. DB2 递归查询

    上一篇中讲解了ORACLE中的递归查询,下面我们看一下DB2中如何使用递归查询: 同样的我们先新建一个表来存储以上信息,并插入测试数据: --建表 create table FAMILY ( pers ...

  7. ocp 1Z0-047 1-60题解析

    1. You need to load information about new customers from the NEW_CUST table into the tables CUST and ...

  8. HDU 5665 Lucky (水题)

    Lucky 题目链接: http://acm.hust.edu.cn/vjudge/contest/123316#problem/G Description Chaos August likes to ...

  9. VC中监测函数运行时间

    VC++编程时,经常会监控某个算法的计算时间,以确定算法的效率.编码举例如下, //========start: algorithm time============= // SYSTEMTIME s ...

  10. matlab eps中文乱码的解决方法

    直接存成eps总是乱码 最优解决方法是matlab print 保存成jpg,之后用adobe  acrobat pro 打开jpg文件另存为eps