Download the PHP package lucinda/mailing without Composer

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

PHP Mailing API

Very lightweight PHP API covering most important parts of RFC-4021, the worldwide standard at this moment for email sending, along with RFC-6376 for digital signatures.

API requires PHP 8.1+ and comes with just four classes, all belonging to Lucinda\Mail namespace:

The entire logic of email message is encapsulated by class Message via following public methods:

Method Description
__construct Constructs an email message by subject and body
addAttachment Adds an attachment to message body
setFrom Sets message sender's address, as seen in recipients' mail boxes
setSender Sets message sender's address, as seen by recipients' mail server
setReplyTo Adds address message receiver should reply to
addTo Adds address to send mail to (mandatory)
addBCC Adds address to discreetly send a copy of message to (invisible to others)
addCC Adds address to publicly send a copy of message to
setContentType Sets message body content type (strongly recommended)
setDate Sets time message was sent at as date header
setMessageID Sets domain name in order to generate a message ID (strongly recommended)
setSignature Sets a DKIM-Signature header is to be generated (strongly recommended)
addCustomHeader Sets a custom header to send in email message
send Sends message to destination

Simple example:

construct<a href="construct">

This method constructs a mail message by following arguments:

Name Type Description
$subject string Subject of email message (mandatory). Must be single-lined!
$body string Body of email message (mandatory). Can be multi-lined!

addAttachment

Adds an attachment to message body based on argument:

Name Type Description
$path string Absolute disk path of file to be attached.

Example:

setFrom

Sets address of message author as seen by recipients (see: from header) based on argument:

Name Type Description
$address Address Address that appears as message author

Usually calling this method is not necessary, unless developer wants a different from address from that default.

Example:

setSender

Sets address of message author as seen by destination mail server (see: from header) based on argument:

Name Type Description
$address Address Address that appears as message author

Should be same as from address, unless mail server is sending messages on behalf of someone else.

Example:

setReplyTo

Sets address to send message replies to (see: Reply-To header) based on argument:

Name Type Description
$address Address Address to send reply to

Should always be set IF we desire messages to be replied to.

Example:

addTo

Adds an address to send message to (see: To header) based on argument:

Name Type Description
$address Address Address to send message to

At least one address must always be set!

Example:

addCC

Adds an address to send a copy of message to allowing others to notice (see: Cc header) based on argument:

Name Type Description
$address Address Address to send copy of message to

Example:

addBCC

Adds an address to send a copy of message to without others to notice (see: Bcc header):

Name Type Description
$address Address Address to send copy of message to

Example:

setContentType

Sets message body's content type and character set by following arguments (see: Content-Type header):

Name Type Description
$contentType string Message body content type
$charset string Character set of message body

Example:

setDate

Sets custom date message was sent at based on argument (see: Date header):

Name Type Description
$date int UNIX time at which message was written

Usually it is not necessary to send this header unless you want to trick receiver(s) it originated at a different date.

Example:

setMessageID

Sets unique ID of message to send based on argument (see: Message-ID header):

Name Type Description
$domainName string Your server's domain name.

It is strongly recommended to send this header in order to prevent having your message labeled as spam by recipient mail servers!

Example:

setSignature

Sets a digital signature of message to send based on arguments (see: DKIM-Signature header):

Name Type Description
$rsaPrivateKey string RSA private key to sign messages with
$rsaPassphrase string Password RSA private key was created with, if any (use "" if none)
$domainName string Your server's domain name (same as that used by Message-ID).
$dnsSelector string Name of specific DKIM public key record in your DNS
$signedHeaders array List of headers that participate in signature

In order to prevent having your message labeled as spam by recipient mail servers, setting this header is strongly recommended! To get values for params above, follow this guide:

The algorithm used in generating DKIM-Signature header has been taken from php-mail-signature and refactored completely because original was chaotic and poorly programmed. The end result was class DKIM!

Example:

addCustomHeader

Adds a RFC-4021 header not covered by commands above using following arguments:

Name Type Description
$name string Name of header
$value string Value of header

Example:

Above command adds a List-Unsubscribe header which allows users to unsubscribe from mailing lists by a button click.

send

Packs message body and headers, compiles latter with DKIM-Signature (if available) and sends mail to destination.

Example:


All versions of mailing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-fileinfo Version *
ext-openssl Version *
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 lucinda/mailing contains the following files

Loading the files please wait ....