Skip to content

A wrapper for php's mail function that allows you to easily construct and send mails.

License

Notifications You must be signed in to change notification settings

manjutapali/easy-mail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easy-mail

A wrapper for php's mail function that allows you to easily construct and send mails.

Install

With composer:

composer require pushkar/simple-mailer

Usage

require_once "../../path/to/vendor/autoload.php";

use EasyMail\Mail;

//Example 1

$mail = new Mail("[email protected]");
$mail->setSubject("Subject");
$mail->setMsg("Msg");
if($mail->sendMail()) {
    echo "Mail Sent.";
}

//Example 2

$mail = new Mail("[email protected]", "Subject", "Msg');
if($mail->sendMail()) {
    echo "Mail Sent.";
}

//Some methods

//For a reply-to header
$mail->addReplyTo("[email protected]", Name);

//For html email
$mail->isHtml(true);

//For adding custom header
$mail->customHeaders($header);

//set From
$mail->setFrom($email, $name);

//All methods
isHtml(bool);
setSubject(string);
setMsg(string);
addCC(string);
addBcc(string);
customHeader(string);
addReplyTo(string, string|null);
setFrom(string, string|null);
addAttachment(string)
sendMail();

License

Copyright (c) 2018 Pushkar Anand. Under MIT License.

About

A wrapper for php's mail function that allows you to easily construct and send mails.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%