定制 machour/swiftmailer-ethereal-transport 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

machour/swiftmailer-ethereal-transport

最新稳定版本:1.0.0

Composer 安装命令:

composer require machour/swiftmailer-ethereal-transport

包简介

A simple Ethereal transport for Swift Mailer

README 文档

README

This is a simple transport for Swift Mailer that uses Ethreal, the fake SMTP service.

This transport is meant to be used while developing your application, in order to preview the message, without it getting actually sent.

Using this transport, you can set a callback that will be invoked with the URL to the message preview as its first and only argument.

Installation

composer require machour/swiftmailer-ethereal-transport

Usage

use Machour\SwiftMailerEtherealTransport\EtherealTransport;

// Create the Transport
$transport = (new EtherealTransport())
  // Get your credential at https://ethereal.email/create
  ->setUsername('your username')
  ->setPassword('your password')
  // Display the URL in your logs, store it session, or whatever ..
  ->setCallback(function (string $url) use ($logger) {
      $logger->debug("Email sent to Ethereal, see it at $url");
  });

// Create the Mailer using your created Transport
$mailer = new Swift_Mailer($transport);

// Create a message
$message = (new Swift_Message('Wonderful Subject'))
  ->setFrom(['john@doe.com' => 'John Doe'])
  ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name'])
  ->setBody('Here is the message itself');

// Send the message
$result = $mailer->send($message);

Note

Note Swift Mailer is deprecated, use this extension if you're stuck with a legacy app.

See also

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-09-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固