1. Go to this page and download the library: Download lithemod/mail 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/ */
lithemod / mail example snippets
ithe\Support\Mail;
use Lithe\Support\Env;
// Load environment variables
Env::load(__DIR__);
// Send the email
$mail = Mail::to('[email protected]', 'Recipient Name')
->subject('Email Subject')
->text('Body of the email in plain text')
->send();
if ($mail) {
echo 'Email sent successfully!';
} else {
echo 'Failed to send email.';
}
$mail = Mail::to('[email protected]', 'Recipient Name')
->subject('Email Subject')
->html('<h1>Email body in HTML</h1>')
->send();
if ($mail) {
echo 'Email sent successfully!';
} else {
echo 'Failed to send email.';
}
$mail = Mail::to('[email protected]', 'Recipient Name')
->cc('[email protected]', 'CC Name')
->subject('Email Subject')
->text('Body of the email in plain text')
->send();
$mail = Mail::to('[email protected]', 'Recipient Name')
->bcc('[email protected]', 'BCC Name')
->subject('Email Subject')
->text('Body of the email in plain text')
->send();
$mail = Mail::to('[email protected]', 'Recipient Name')
->replyTo('[email protected]', 'Reply-To Name')
->subject('Email Subject')
->text('Body of the email in plain text')
->send();
$mail = Mail::to('[email protected]', 'Recipient Name')
->subject('Email Subject')
->text('Body of the email in plain text')
->attach('/path/to/file.txt', 'CustomFilename.txt')
->send();
$mail = Mail::to('[email protected]', 'Recipient Name')
->subject('Email Subject')
->text('Body of the email in plain text')
->addHeader('X-Custom-Header', 'HeaderValue')
->send();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.