cafewebcode/webcodemail

通过 PHPMailler 发送邮件的简单组件 CafeWebCodeEmail

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

This package is auto-updated.

Last update: 2024-09-21 21:49:57 UTC


README

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

简化 PHPMailler 使用的高级组件

使用外观模式抽象 PHPMailler 发送邮件功能的简单组件。一个用于简化并加速您开发的组件。

关于 CafeWebCodeEmail

CafeWebCodeEmail 是一组小巧且优化的 PHP 组件,用于常见任务。由 Cleyber F. Matos 维护。

文档

<?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());
}
发送附件
<?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

支持

安全:如果您发现任何安全问题,请通过电子邮件 cleyber.fernandes@gmail.com 而不是使用问题跟踪器。

谢谢

致谢

许可证

MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件