PHP code example of khaleejinfotech / multi-tenant-mailer
1. Go to this page and download the library: Download khaleejinfotech/multi-tenant-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/ */
khaleejinfotech / multi-tenant-mailer example snippets
'providers' => [
// ...
Khaleejinfotech\MultiTenantMailer\MultiTenantMailerServiceProvider::class,
],
3. **Publish Configuration:** After installation, publish the configuration file and any
use Khaleejinfotech\MultiTenantMailer\MultiTenantMailer;
$mailer = new MultiTenantMailer();
$mailer->init($host, $port, $username, $password, $encryption);
$mailer->setFrom($fromAddresses, $fromName)
->setTo($toAddresses, $toName)
->setSubject($subject)
->setBody($body)
->setContentType('text/html')
->setAttachments($attachments)
->shouldQueue(); // Optional: Set to true if you want to queue the email
$mailer->send();
use Khaleejinfotech\MultiTenantMailer\Contracts\MultiTenantMailerSettings;
$mailerSettings = new MultiTenantMailerSettings();
$mailerSettings->setHost($host)
->setPort($port)
->setUsername($username)
->setPassword($password)
->setEncryption($encryption)
->setFromAddress($fromAddress, $fromName);
use Khaleejinfotech\MultiTenantMailer\MultiTenantMailer;
$mailer = new MultiTenantMailer();
$mailer->withSettings($mailerSettings);