1. Go to this page and download the library: Download apeli/apelimailers 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/ */
apeli / apelimailers example snippets
ApeliMailers\Core\Mailer;
use ApeliMailers\Transport\SmtpTransport;
// Configure transport
$transport = new SmtpTransport(
'smtp.example.com',
587,
'username',
'password',
'tls'
);
// Initialize mailer
$mailer = new Mailer($transport);
// Create and send message
$message = $mailer->createMessage()
->from('[email protected]', 'Sender Name')
->to('[email protected]', 'Recipient Name')
->subject('Hello from ApeliMailers')
->html('<h1>Welcome!</h1><p>This is an email sent with ApeliMailers.</p>');
$result = $mailer->send($message);
$transport = new SmtpTransport(
'smtp.example.com', // Host
587, // Port
'username', // Username
'password', // Password
'tls', // Encryption: 'tls', 'ssl', or null
false // Debug mode (optional)
);
use ApeliMailers\Transport\SendmailTransport;
$transport = new SendmailTransport('/usr/sbin/sendmail -bs');