Download the PHP package desttools/transmail without Composer

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

Zoho ZeptoMail API PHP Client (formerly TransMail)

Generic PHP API Client for Zoho's ZeptoMail service

This unofficial ZeptoMail/Transmail PHP library allows you to easily send transactional email messages via the Zoho ZeptoMail API.

The ZeptoMail system is intended for transactional emails related to website and app interactions (receipts, password resets, 2FA notices, etc.), not bulk sending of emails like newsletters and announcements. Please see the ZeptoMail site for details about use cases and guidelines.

Developer Note

This library was created when this service was called Transmail. Other than the name on the Zoho documentation and a new API endpoint, the API is identical as before and as of this writing in August 2021 it continues to work even with the old Transmail endpoint. At some point in the future, I plan to update this library to reflect the new branding. Until then, it will continue to be used and namespaced as "transmail"

Installation

For most uses we recommend installing the desttools/transmail package via Composer. If you have Composer installed already, you can add the latest version of the package with the following command:

Or if you're adding this library to an application, in your composer.json file

Alternately, you can simply clone this repository directly to include the source code in your project.

Settings

Before you can connect to the API, you'll need two settings from your ZeptoMail account: an authorization key and a bounce address

If you are using an environment file, you'll want to create settings with these setting:

If you aren't using environment variables in your application, you can omit this step and pass these settings directly to the mailer (see full example below).

To load the library in your page or app, you'll need to include the file:

Note: Your ability to send messages also requires that the sender's domain is pre-verified in your ZeptoMail dashboard. Without that, you will see authentication errors.

Basic Mailing Example:

Note: You can pass all email addresses either as a string or as an array, like this:

If using an array, the formatter will look for the email address in either the first or second element position. If it finds an address, it will use the remaining element as the text name. If additional elements are passed here they will be ignored.

Full Example

Below are ALL the possible options, including manually setting an authorization key and bounce address:

Error Handling

When you actually load the library, there is a 4th parameter that can be passed to turn on verbose error reporting. By default, this is off and the function returns TRUE (message sent) and FALSE (message not sent).

There are two main possible points of failure that can occur: The cURL request could fail, or the API request could fail. In both cases, the function will return a generic FALSE unless you have verbose errors turned on.

With Verbose Errors Turned On:

In the event of a cURL error, a string will be returned with the specific PHP error code.

In the event of API success or failure, a JSON object with the entire API response will be returned. Consult the ZeptoMail documentation for error codes and other details about these messages.

ZeptoMail API Error Codes

Security Note: These verbose messages could divulge sensitive info about your site or your ZeptoMail account, so errors should be captured or turned off in a production setting.

Additional Headers

Passing additional headers to the email server is possible. Simply create any name-value pairs you want as an array and pass that to the function

Sending Attachments

Sending attachments means loading the file into PHP's memory, converting to a Base64-encoded stream and then passing that to the function. Since there are three parameters needed by ZeptoMail, it is generally advised to first set up the attachments as an array and then pass that to the function:

List of unsupported attachments

Zoho ZeptoMail API Documentation

NOTE: This library only sends messages through the ZeptoMail API system. If you are attempting to send via SMTP, please consult the documentation for your web or email server's mail program for SMTP relaying.


All versions of transmail with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6.0 || ^7.0
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 desttools/transmail contains the following files

Loading the files please wait ....