Download the PHP package atk14/sendmail without Composer

On this page you can find all versions of the php package atk14/sendmail. 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 sendmail

Sendmail

Build Status

Sendmail is a replacement for function mail() in PHP.

Basic usage

Function sendmail() can be called the same way like built-in function mail().

sendmail(string $to , string $subject , string $message [, mixed $additional_headers [, string $additional_parameters ]])

So in a legacy project every mail() occurrence can be replaced with sendmail().

sendmail("[email protected]","Thank you for registration","Dear John\n\nthank you for your registration...");

Sendmail can also be called with associative array which offers more options.

$mail_ar = sendmail([
  "from" => "[email protected]",
  "from_name" => "Snake Oil",
  // or "from" => "Snake Oil <[email protected]>",

  // "return_path" => "[email protected]",

  // "reply_to" => "[email protected]",
  // "reply_to_name" => "Snake Oil",

  "to" => "John Doe <[email protected]>",
  // "cc" => "",
  // "bcc" => "",

  "subject" => "Thank you for registration",
  "body" => "Dear John\n\nthank you for registration...",
  // "mime_type" => "text/plain",
  // "charset" => "UTF-8",
  // "transfer_encoding" => "quoted-printable",

  "attachments" => [
    [
      "body" => file_get_contents("/path/to/file"),
      "filename" => "confirmation.pdf",
      "mime_type" => "application/pdf",
    ],[
      "body" => file_get_contents("/path/to/another/file"),
      "filename" => "id_card.png",
      "mime_type" => "image/png"
    ]
  ],

  // "build_message_only" => false,
]);

Returned value is an associative array, which contains the complete assembled message and also a boolean status "accepted_for_delivery". The array can be used as a parameter for another sendmail() call.

$mail_ar = sendmail([
  ...
  "build_message_only" => true
])

$mail_ar["to"] = "[email protected]";
sendmail($mail_ar);

$mail_ar["to"] = "[email protected]";
sendmail($mail_ar);

// and so on

Sending HTML emails with images

For sending HTML emails there is another function sendhtmlmail().

$mail_ar = sendhtmlmail([
  "to" => "[email protected]",

  "subject" => "Sample HTML email",
  "plain" => "Plain text version",
  "html" => "<html>Html version<img src="cid:c8792dkQW"><br><img src="cid:tytdk2392981"></html>",

  "images" => [
    [
      "filename" => "sea.gif",
      "content" => $binary_content,
      "cid" => "c8792dkQW",
    ],
    [
      "filename" => "mountain.jpg",
      "content" => $binary_content_2,
      "cid" => "tytdk2392981",
    ]
  ]
]);

Configuration constants

There are several constants that affect the default behavior of Sendmail. Please note that they must be defined before Sendmail is being loaded.

define("SENDMAIL_DEFAULT_FROM","[email protected]");
define("SENDMAIL_DEFAULT_FROM_NAME","Snake Oil");
define("SENDMAIL_DEFAULT_BODY_CHARSET","UTF-8");
define("SENDMAIL_DEFAULT_BODY_MIME_TYPE","text/plain");
define("SENDMAIL_BODY_AUTO_PREFIX",""); // "This is a testing message\nIgnore it. Do not reply!\n\n\n"
define("SENDMAIL_USE_TESTING_ADDRESS_TO","");
define("SENDMAIL_DO_NOT_SEND_MAILS",((defined("DEVELOPMENT") && DEVELOPMENT) || (defined("TEST") && TEST)));
define("SENDMAIL_EMPTY_TO_REPLACE","[email protected]");
define("SENDMAIL_DEFAULT_TRANSFER_ENCODING","8bit"); // "8bit" or "quoted-printable"
define("SENDMAIL_MAIL_ADDITIONAL_PARAMETERS","[email protected]");
define("SENDMAIL_BCC_TO","[email protected]");

Installation

Just use the Composer:

composer require atk14/sendmail

License

Sendmail is free software distributed under the terms of the MIT license


All versions of sendmail with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
atk14/translate Version 1.*
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 atk14/sendmail contains the following files

Loading the files please wait ....