<?php
$sendinblue = \OmniSmtp\OmniSmtp::create(\OmniSmtp\SendInBlue::class, 'test-api-key');
$sendinblue->setSubject('The Mail Subject')
->setFrom('[email protected]')
->setRecipients('[email protected]', '[email protected]')
->setContent('<p>Hello From SendInBlue OmniSmtp</p>')
->send();
All mail providers must implement \OmniSmtp\Common\ProviderInterface
, and will usually extend \OmniSmtp\Common\AbstractProvider
for basic functionality.
The following drivers are available:
Driver | 3.x | Composer Package | Maintainer | Installation |
---|---|---|---|---|
sendinblue | ✓ | omnismtp/sendinblue | Jeff Claud | composer require omnismtp/sendinblue |
sendgrid | ✓ | napoleon/omnismtp-sendgrid | Napoleon Cariño | composer require napoleon/omnismtp-sendgrid |
The main method implemented by drivers are:
getAuthorizationHeaderName()
- smtp provider authorization header name. UsuallyAuthorization
.getSmtpEndpoint()
- web api endpoint of smtp providers.
Optional setter methods you may want to implement:
setFrom(string $email)
- Email of the sender.setRecipients(...$recipients)
- List of recipients email.setContent(string $html)
- Email html content.
Note: When implementing these setter methods in your own, you may call setData($key, $value)
to set your data. Ex.
<?php
public function setFrom(string $email)
{
return $this->setData(self::FROM, $email);
}