1. Go to this page and download the library: Download pardnchiu/mailer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pardnchiu / mailer example snippets
use pardnchiu\Mailer;
// Direct static call
$result = Mailer::send([
"email" => "[email protected]",
"subject" => "Test Email",
"body" => "<h1>This is a test email</h1>",
"isHtml" => true
]);
if ($result) {
echo "Email sent successfully";
} else {
echo "Email sending failed";
}
use pardnchiu\Mailer;
// Initialize mail client
$mailer = new Mailer();
// Basic email sending (calling static method through instance)
$result = $mailer::send([
"email" => "[email protected]",
"subject" => "Test Email",
"body" => "<h1>This is a test email</h1>",
"isHtml" => true
]);
if ($result) {
echo "Email sent successfully";
} else {
echo "Email sending failed";
}