Download the PHP package fuel/email without Composer

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

Fuel Email Package.

A full fledged email class for Fuel. Send mails using php's mail function, sendmail or SMTP.

Summary

Usage

$mail = Email::forge();
$mail->from('[email protected]', 'Your Name Here');

// Set to
$mail->to('[email protected]');

// Set with name
$mail->to('[email protected]', 'His/Her Name');

// Set as array
$mail->to(array(
    // Without name
    '[email protected]',

    // With name
    '[email protected]' => 'His/Her Name',
));

// Work the same for ->cc and ->bcc and ->reply_to

// Set a body message
$email->body('My email body');

// Set a html body message
$email->html_body(\View::forge('email/template', $email_data));

/**

    By default this will also generate an alt body from the html,
    and attach any inline files (not paths like http://...)

**/

// Set an alt body
$email->alt_body('This is my alt body, for non-html viewers.');

// Set a subject
$email->subject('This is the subject');

// Change the priority
$email->priority(\Email::P_HIGH);

// And send it
$result = $email->send();

Exceptions

+ \EmailValidationFailedException, thrown when one or more email addresses doesn't pass validation
+ \EmailSendingFailedException, thrown when the driver failed to send the exception

Example:

// Use the default config and change the driver
$email = \Email::forge('default', array('driver' => 'smtp'));
$email->subject('My Subject');
$email->html_body(\View::forge('email/template', $email_data));
$email->from('[email protected]', 'It's Me!');
$email->to('[email protected]', 'It's the Other!');

try
{
    $email->send();
}
catch(\EmailValidationFailedException $e)
{
    // The validation failed
}
catch(\EmailSendingFailedException $e)
{
    // The driver could not send the email
}

Priorities

These can me one of the following:

+ \Email::P_LOWEST - 1 (lowest)
+ \Email::P_LOW - 2 (low)
+ \Email::P_NORMAL - 3 (normal) - this is the default
+ \Email::P_HIGH - 4 (high)
+ \Email::P_HIGHEST - 5 (highest)

Attachments

There are multiple ways to add attachments:

$email = Email::forge();

// Add an attachment
$email->attach(DOCROOT.'dir/my_img.png');

// Add an inline attachment
// Add a cid here to point to the html
$email->attach(DOCROOT.'dir/my_img.png', true, 'cid:my_conten_id');

You can also add string attachments

$contents = file_get_contents($my_file);
$email->string_attach($contents, $filename);

By default html images are auto included, but it only includes local files. Look at the following html to see how it works.

// This is included
<img src="path/to/my/file.png" />

// This is not included
<img src="http://remote_host/file.jpeg" />

Drivers

The drivers allow the use of this library with mostly anything that can send mails.

Mailgun

Mailgun is an online service by Rackspace (http://www.mailgun.com/) that allows you to send emails by demand. You will need to install the mailgun library (https://github.com/mailgun/mailgun-php) with composer in your FuelPHP.

Once you have installed the package you will have to set up the config for your App:

That's it. Questions?


All versions of email with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.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 fuel/email contains the following files

Loading the files please wait ....