2017 © Pedro Peláez
 

library pechkin

Pechkin is a small and easy-to-use mailing library for PHP

image

maxfreck/pechkin

Pechkin is a small and easy-to-use mailing library for PHP

  • Friday, May 11, 2018
  • by maxfreck
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 50 % Grown

The README.md

Pechkin — a small and easy-to-use mailing library for PHP

Features

  • Support for PSR-7 streams.
  • Send emails with multiple To, Cc, Bcc and Reply-to addresses.
  • Send emails through http/socks proxy.
  • Support for raw, multipart/alternative, multipart/mixed and multipart/related emails.

Installing Pechkin

The recommended way to install Pechkin is through Composer., (*1)

Install Composer:, (*2)

curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Pechkin:, (*3)

php composer.phar require maxfreck/pechkin

After installing, you need to require Composer's autoloader:, (*4)

require 'vendor/autoload.php';

You can then later update Pechkin using composer:, (*5)

bash composer.phar update, (*6)

Using Pechkin

All email metainformation (content type, file name, attachment disposition) is passed as a stream metadata., (*7)

Basic usage example:, (*8)

<?php

//use composer's autoloader
require '../vendor/autoload.php';

use \Pechkin\CurlMailer;
use \Pechkin\Streams\FileStream;

use \Pechkin\fn;


fn::$host = 'example.org';

$body = <<<EOD
<h1>Lorem ipsum</h1>


Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum., (*9)

EOD; $mailer = new CurlMailer( "smtps://smtp.example.org:465", "nemo@example.org", "Nemo's password", (object)[ 'from' => (object)['email' => 'nemo@example.org', 'name' => 'Nemo Nobody'], 'replyTo' => [ (object)['email' => 'nemo@example.org', 'name' => 'Nemo Nobody'], ], 'to' => [ (object)['email' => 'foo@example.com', 'name' => 'Mr. Foo'], ], 'subject' => "Hello, Mr. Foo", 'body' => FileStream::fromString($body, ['content-type' => 'text/html; charset="utf-8"']), 'altBody' => FileStream::fromString("This is alt body"), //'proxy' => 'socks5://127.0.0.1:8080' //See CURLOPT_PROXY for more information ] ); $mailer->addAttachment( new FileStream( 'image.png', 'r', [ 'content-type' => fn::fileMime('image.png'), 'name' => 'image.png', 'disposition' => 'inline' ] ), 'img1' //Attachment content ID ); $mailer->send();

To-Do

  • Raw SMTP sender similar to PHPMailer.

The Versions

11/05 2018

dev-master

9999999-dev

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Freck

curl email library client smtp smtp client

11/05 2018

v0.6.1

0.6.1.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Freck

curl email library client smtp smtp client

23/02 2018

v0.6.0

0.6.0.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Freck

curl email library client smtp smtp client

19/02 2018

v0.5.5

0.5.5.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Freck

curl email library client smtp smtp client

17/02 2018

v0.5.4

0.5.4.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

by Maxim Freck

curl email library client smtp smtp client

08/02 2018

v0.5.3

0.5.3.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

by Maxim Freck

curl email library client smtp smtp client

05/02 2018

v0.5.2

0.5.2.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

by Maxim Freck

curl email library client smtp smtp client

05/02 2018

v0.5.1

0.5.1.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

by Maxim Freck

curl email library client smtp smtp client

03/02 2018

v0.5.0

0.5.0.0

Pechkin is a small and easy-to-use mailing library for PHP

  Sources   Download

MIT

The Requires

 

by Maxim Freck

curl email library client smtp smtp client