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. openfl关于windows平台编译报错解决办法

    报错信息:  无法打开程序数据库“e:\newproj\mainclient\bin\windows\cpp\obj\obj\msvc-debug-ncxp\vc.pdb”:如果要将多个 CL.EXE ...

  2. MFC字体与文本输出

    字体 成员函数 1.CFont( ); 构造一个CFont对象.此对象在使用之前应该先使用CreateFont.CreateFontIndirect.CreatePointFont或CreatePoi ...

  3. 如何在 Windows Azure 的虚拟机 ubuntu 上面安装和配置 openVPN(一)

    这篇文章,既是写给大伙儿的,也是写给自己的.本文要求读者需要有一定的英文基础和动手能力. 因为有MSDN subscriptions,所以每个月有100$可以使用windows azure,于是想尝试 ...

  4. Xcode 6 越狱开发基础

    最近接触到XCode越狱开发的问题,越狱开发首先iphone设备得越狱,然后安装Appsync,安装之后,安装ipa将不再验证程序签名的有效性,不签名的程序也可以直接在设备上运行,只需要保证IPA本身 ...

  5. CORBA

    公共对象请求代理体系结构(Common Object Request Broker Architecture)

  6. pku3668 Game of Lines

    http://poj.org/problem?id=3668 水题,STL #include <stdio.h> #include <set> using namespace ...

  7. LinkButton(按钮)

    使用$.fn.linkbutton.defaults重写默认值对象. 按钮组件使用超链接按钮创建.它使用一个普通的<a>标签进行展示.它可以同时显示一个图标和文本,或只有图标或文字.按钮的 ...

  8. JDBC学习笔记(4)——PreparedStatement的使用

    PreparedStatement public interface PreparedStatement extends Statement;可以看到PreparedStatement是Stateme ...

  9. AVD设置屏幕大小

    相关资料: 1.http://jingyan.baidu.com/article/fedf0737775d2835ac897700.html

  10. HDU 3265 Posters (线段树+扫描线)(面积并)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3265 给你n个中间被挖空了一个矩形的中空矩形,让你求他们的面积并. 其实一个中空矩形可以分成4个小的矩 ...