2017 © Pedro Peláez
 

library socket-mailer

PHP SMTP Mailer library using fsockopen.

image

yidas/socket-mailer

PHP SMTP Mailer library using fsockopen.

  • Wednesday, June 13, 2018
  • by yidas
  • Repository
  • 1 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP Socket Mailer

PHP SMTP Mailer library implemented by socket, (*1)

Latest Stable Version Latest Unstable Version License, (*2)


DEMONSTRATION

$mailer = new \yidas\socketMailer\Mailer([
    'host' => 'mail.your.com',
    'username' => 'service@your.com',
    'password' => 'passwd',
    ]);

$result = $mailer
    ->setSubject('Mail Title')
    ->setBody('Content Text')
    ->setTo(['name@your.com', 'peter@your.com' => 'Peter'])
    ->setFrom(['service@your.com' => 'Service Mailer'])
    ->setCc(['cc@your.com' => 'CC Receiver'])
    ->setBcc(['bcc@your.com'])
    ->send();

REQUIREMENTS

This library requires the following:, (*3)

  • PHP 5.4.0+

INSTALLATION

Run Composer in your project:, (*4)

composer require yidas/socket-mailer

Then you could call it after Composer is loaded depended on your PHP framework:, (*5)

require __DIR__ . '/vendor/autoload.php';

use \yidas\socketMailer\Mailer;

CONFIGURATION

To use localhost MTA:, (*6)

$mailer = new \yidas\socketMailer\Mailer()

To configure a external MTA server:, (*7)

$mailer = new \yidas\socketMailer\Mailer([
    'host' => 'mail.your.com',
    'username' => 'service@your.com',
    'password' => 'passwd',
    'port' => 587,
    'encryption' => 'tls',
    ]);

SSL Connection

$mailer = new \yidas\socketMailer\Mailer([
    // ...
    'port' => 465,
    'encryption' => 'ssl',
    ]);

Non-Auth Connection

If you want to connect to SMTP relay server with free auth in allowed networks:, (*8)

$mailer = new \yidas\socketMailer\Mailer([
    'host' => 'mail.your.com',
    'port' => 25,
    ]);

USAGES

debugOn()

public self debugOn()

setFrom()

public self setFrom(string|array $form) 

setTo()

public self setTo(array $recipients) 

setCc()

public self setCc(array $recipients) 

setBcc()

public self setBcc(array $recipients) 

setBody()

public self setBody(string $text) 

setSubject()

public self setSubject(string $title) 

addHeader()

public self addHeader($key, $value) 

Example:, (*9)

$mailer = $mailer->addHeader('Your-Header-Name', 'the header value');

send()

public boolean send()

The Versions

13/06 2018

dev-master

9999999-dev https://github.com/yidas/php-socket-mailer

PHP SMTP Mailer library using fsockopen.

  Sources   Download

MIT

php mailer smtp socket fsockopen

13/06 2018

1.0.0

1.0.0.0 https://github.com/yidas/php-socket-mailer

PHP SMTP Mailer library using fsockopen.

  Sources   Download

MIT

php mailer smtp socket fsockopen

14/04 2018

0.1.0

0.1.0.0 https://github.com/yidas/php-socket-mailer

PHP SMTP Mailer library using fsockopen.

  Sources   Download

MIT

php mailer smtp socket fsockopen