承接 copernica/smtpeter-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

copernica/smtpeter-php

最新稳定版本:v1.0.1

Composer 安装命令:

composer require copernica/smtpeter-php

包简介

PHP lib to send emails with SMTPeter API

README 文档

README

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.

Installation

Package can be installed via composer cli, executing following line.

composer require copernica/smtpeter-php

Example

Sending very simple email message can be done with following script.

/**
 *  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><h1>HTML version</h1></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();

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 10
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-28