Skip to content

ukor/send_mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Send mail

About

Send mail is simple script base on swift mailer, that make sending of emails from your php app a breeze.

Installation

Note that installing send mail also install swift mailer version(^6.0) and all its dependency.

composer require "ukorjidechi/send_mail:^0.1"
  • Change the username and password property in send_mail.php (The file has been well commented for easy configuration).

Example

<?php

require __DIR__."/path/to/vendor/autoload.php";

try {
    
    $sender_email_addr = "sender@example.com";
    $sender_name = "Sender Name";
    $recipient_email_addr = "recipient@example.com";
    $recipient_name = "Recipient Name";
    $subject = "Email Subject";
    $html_message = "<h2>This is the HTML part of the email message</h2>";
    $plain_message = "This is the plain part of the email message";
    
    (new \ukorJidechi\mail\send_mail(
                                     $sender_email_addr, $sender_name, 
                                     $recipient_email_addr, $recipient_name, 
                                     $subject, $html_message, $plain_message
                                     ));
}catch(Exception $exception)
{
    echo $exception->getMessage() ."<br><br>". $exception->getCode(). "<br><br>".$exception->getTraceAsString();
}
?>

Happy coding.

About

A simple mail class for sending email via swiftmailer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages