cafewebcode/webcodemail

A simple component for sending emails through PHPMailler CafeWebCodeEmail

dev-master 2023-08-21 19:11 UTC

This package is auto-updated.

Last update: 2025-08-22 00:04:52 UTC


README

Maintainer Source Code PHP from Packagist Software License Build Quality Score Total Downloads

Simple component to make PHPMailler easier to use

Simple component that uses the facade pattern to abstract PHPMailler functions for sending emails. A component to facilitate and speed up your development.

About CafeWebCodeEmail

CafeWebCodeEmail is a set of small and optimized PHP components for common tasks. Held by Cleyber F. Matos.

Documentation

<?php

require __DIR__ . "/../src/config.php";
require __DIR__ . "/../vendor/phpmailer/phpmailer/src/PHPMailer.php";
require __DIR__ . "/../vendor/phpmailer/phpmailer/src/Exception.php";
require __DIR__ . "/../vendor/phpmailer/phpmailer/src/SMTP.php";
require __DIR__ . "/../src/Mail.php";

use Cafewebcode\Cafewebcodemail\Mail;

$mail = new Mail();

$mail->bootstrap(
    "test submission " . time(),
    "<h1>Hello Word</h1><p>This is an email sending test</p>",
    "email@email.com.br",
    "recipient name"
);

if ($mail->send("frommail@mail.com.br", "from name")) {
    echo "Sent with success";
} else {
    var_dump($mail->fail());
}
Sending attachments
<?php

$mail = new Mail();

$mail->bootstrap(
    "test submission " . time(),
    "<h1>Hello Word</h1><p>This is an email sending test</p>",
    "email@email.com.br",
    "recipient name"
);

$mail->attach("file path", "file Name");
$mail->attach("file path", "file Name");

$mail->send("frommail@mail.com.br", "from name");

Contributing

Please see CONTRIBUTING for details.

Support

Security: If you discover any security related issues, please email cleyber.fernandes@gmail.com instead of using the issue tracker.

Thank you

Credits

License

The MIT License (MIT). Please see License File for more information.