PHP code example of leoflapper / mailprovider
1. Go to this page and download the library: Download leoflapper/mailprovider 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/ */
leoflapper / mailprovider example snippets
$service = new MailProvider\Service\PHPMailer();
$service
->setProtocol('smtp')
->setHost('localhost')
->setPort(1025)
->addTo('[email protected] ', 'Leo Flapper')
->addCc('[email protected] ', 'Leo Flapper')
->addBcc('[email protected] ', 'Leo Flapper')
->setFrom('[email protected] ', 'Leo Flapper')
->setSubject('My Subject')
->setHtml('<p>Beautiful content</p>')
->addAttachment('../LICENSE.md', 'Attachment.txt')
->addHeader('MyHeader', 'Value')
->setReplyTo('[email protected] ');
$service->send();
//$service = new MailProvider\Service\SendGrid('API-KEY');
//$service = new MailProvider\Service\Mailgun('API-KEY');
$service = new MailProvider\Service\Mandrill('API-KEY');
$service
->addTo('[email protected] ', 'Leo Flapper')
->addCc('[email protected] ', 'Leo Flapper')
->addBcc('[email protected] ', 'Leo Flapper')
->setFrom('[email protected] ', 'Leo Flapper')
->setSubject('My Subject')
->setText('My text')
->setHtml('<p>Beautiful content</p>')
->addAttachment('../LICENSE.md', 'Attachment.txt')
->addHeader('MyHeader', 'Value')
->setReplyTo('[email protected] ');
$service->send();
bash