Download the PHP package vphantom/email without Composer

On this page you can find all versions of the php package vphantom/email. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package email

Email

[license]() [GitHub release]() Build Status Coverage Status

Create/send multipart MIME messages

Facilitates the creation of MIME compatible messages. It has useful features like easy creation of alternative bodies (i.e. plain+html) and multiple file attachments. It is not a complete implementation, but it is very small which suits my needs.

Installation

Usage

Basically, you instantiate the Email class, set a few headers, add some content parts (at least one) and either build to a string using $msg->build() or send by piping through sendmail with $msg->send().

class Email

Create/send multipart MIME messages.

Example:

require_once 'email.php';
mb_internal_encoding('UTF-8');
$msg = new Email();
$msg->charset = 'UTF-8';
$msg->to = "Someone <[email protected]>";
$msg->from = "Myself <[email protected]>";
$msg->subject = "Friendly reminder service";
$msg->addText("Hello Someone,\n\nThis is your friendly reminder.\n");
$msg->addFile('image/png', '/tmp/test-file.png', 'reminder.png');
$msg->send();

public function __set($name, $value)

Property overloading.

To define any header, set a property of the same name. If the header name contains dashes, use underscores instead and they will be converted to dashes. For example:

$msg = new Email();
$msg->X_Mailer_Info = "My Custom Mailer v0.15";

Parameters:

Returns: null

public function __construct()

Constructor

Returns: object — Email instance

public function addData($type, $displayname, $data)

Add a raw data part to message.

Netiquette: you should add text and HTML parts before any binary file attachments.

Parameters:

Returns: null

public function addFile($filepath, $displayname, $mimetype = null)

Attach a file part to message.

Netiquette: you should add binary files after inline text and HTML parts.

Note that the MIME type is automatically detected from the file itself if not specified.

Parameters:

Returns: null

public function addText($text)

Attach plain text part to message.

Parameters:

Returns: null

public function addHTML($html)

Attach HTML part to message.

Parameters:

Returns: null

public function addTextHTML($text, $html)

Attach a pair of text and HTML equivalents to message.

This implements the "multipart/alternative" type so viewers can expect the text and HTML to represent the same content.

Parameters:

Returns: null

public function build($skipTS = false)

Build message to a string.

Caveat: If you intend to use PHP's mail(), you will need to split headers from the body yourself since PHP needs headers separately, and use the $skipTS argument to extract "To" and "Subject" from the headers. Something like this:

$parts = preg_split('/\r?\n\r?\n/', $msg->build(true), 2);
mail($msg->getTo(), $msg->getSubject(), $parts[1], $parts[0]);

Parameters:

Returns: string — The entire message ready to send (i.e. via sendmail)

public function send()

Build and immediately send message.

Note that you can modify some headers and call build() or send() again on the current message. This can be handy for mailing lists where only the destination changes (and where using the "Bcc" field isn't appropriate, that is.)

Internally, this uses PHP's popen() to invoke your PHP configuration's "sendmail_path" directly. This avoids the extra overhead and formatting limitations of PHP's built-in mail().

Returns: mixed — False if the pipe couldn't be opened, the termination status of the sendmail process otherwise.

MIT License

Copyright (c) 2008-2017 Stéphane Lavergne https://github.com/vphantom

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of email with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vphantom/email contains the following files

Loading the files please wait ....