library smtpeter-php
PHP lib to send emails with SMTPeter API
copernica/smtpeter-php
PHP lib to send emails with SMTPeter API
- Tuesday, September 5, 2017
- by pawel.kuznik.copernica
- Repository
- 12 Watchers
- 1 Stars
- 20 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 4 Forks
- 0 Open issues
- 4 Versions
- 54 % Grown
SMTPeter composer package
A library to abstract API calls to SMTPeter REST API.
It exposes one class: Email. This class can be used to easily created email
message that can be sent via SMTPeter., (*1)
Installation
Package can be installed via composer cli, executing following line., (*2)
composer require copernica/smtpeter-php
Example
Sending very simple email message can be done with following script., (*3)
/**
* REST API token that can be obtained from SMTPeter website.
*/
$apiToken = '';
// create new instance of email message
$email = new SMTPeter\Email($apiToken);
// set the email
$email->setFrom('PaweĆ KuĆșnik <pawel.kuznik@copernica.com>');
$email->setSubject('SMTPeter test email');
$email->setText('text version');
$email->setHtml('<html><body>
HTML version
</body></html>');
// composer array of TO addresses and CC addresses
$to = array('someuser@example.com');
$cc = array('someotheruser@example.com');
// set to and cc
$email->setTo($to);
$email->setCC($cc);
// append recipients
$email->appendRecipients($to);
$email->appendRecipients($cc);
// send the email
$email->send();
dev-master
9999999-dev
https://www.smtpeter.com
PHP lib to send emails with SMTPeter API
Sources
Download
MIT
The Requires
-
php >=5.2.0
-
lib-curl *
-
ext-json *
The Development Requires
email
copernica
smtpeter
v1.0.1
1.0.1.0
https://www.smtpeter.com
PHP lib to send emails with SMTPeter API
Sources
Download
MIT
The Requires
-
php >=5.2.0
-
lib-curl *
-
ext-json *
The Development Requires
email
copernica
smtpeter
v1.0.0
1.0.0.0
https://www.smtpeter.com
PHP lib to send emails with SMTPeter API
Sources
Download
MIT
The Requires
-
php >=5.2.0
-
lib-curl *
-
ext-json *
The Development Requires
email
copernica
smtpeter