PHPackages                             lithemod/mail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. lithemod/mail

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

lithemod/mail
=============

Email sending package based on PHPMailer, simplifying the process of sending SMTP emails in PHP applications. It offers integration with environment variables using the lithemodules/support-env package, ensuring secure and flexible configuration.

v1.0.0(1y ago)014MITPHPPHP ^7.4 || ^8.0

Since Oct 2Pushed 1y agoCompare

[ Source](https://github.com/lithemod/mail)[ Packagist](https://packagist.org/packages/lithemod/mail)[ RSS](/packages/lithemod-mail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Lithe Mail
==========

[](#lithe-mail)

A package that simplifies SMTP email sending in PHP applications, providing flexible integration with environment variables for easy configuration.

Installation
------------

[](#installation)

You can install the package via [Composer](https://getcomposer.org/). Run the following command in your terminal:

```
composer require lithemod/mail
```

Make sure the environment variable package is properly configured, as `support-mail` relies on these settings.

Usage
-----

[](#usage)

Here’s a comprehensive guide on how to use the package to send emails:

### 1. Setting Up Environment Variables

[](#1-setting-up-environment-variables)

Create a `.env` file in the root of your project and define your email settings:

```
MAIL_HOST=smtp.yourprovider.com
MAIL_PORT=587
MAIL_USERNAME=your-email@domain.com
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@domain.com
MAIL_FROM_NAME=Your Name or Company
```

### 2. Sending a Simple Text Email

[](#2-sending-a-simple-text-email)

```
