PHPackages                             arkadip/email-channel - 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. arkadip/email-channel

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

arkadip/email-channel
=====================

Laravel Email Channel Package

v1.0.1(3mo ago)03MITPHPPHP ^8.0

Since Mar 23Pushed 3mo agoCompare

[ Source](https://github.com/Arkadipttv/email-channel)[ Packagist](https://packagist.org/packages/arkadip/email-channel)[ RSS](/packages/arkadip-email-channel/feed)WikiDiscussions main Synced 3w ago

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

📧 Email Channel — Laravel Package
=================================

[](#-email-channel--laravel-package)

A modular Laravel package for sending, receiving, and managing emails using **IMAP** and **SMTP** — with database storage, duplicate prevention, incremental UID-based fetching, API endpoints, and an optional dashboard UI.

---

✨ Features
----------

[](#-features)

\#Feature1Fetch incoming emails via IMAP2Send emails via SMTP3Store emails in database4Prevent duplicate email processing5Incremental fetching using UID tracking6Store metadata (subject, UID, etc.)7API endpoints for email operations8Optional dashboard UI9Auto-fetch emails via Laravel Scheduler10Modular and reusable package architecture---

🧰 Prerequisites
---------------

[](#-prerequisites)

Ensure the following are installed before getting started:

- **PHP** ≥ 8.1
- **Composer** —
- **XAMPP** (Apache + MySQL) —
- **Git** —

---

🚀 Installation &amp; Setup
--------------------------

[](#-installation--setup)

### Step 1 — Create Laravel Application

[](#step-1--create-laravel-application)

```
composer create-project laravel/laravel email-channel-app
cd email-channel-app
```

---

### Step 2 — Install the Package

[](#step-2--install-the-package)

```
composer require arkadip/email-channel
```

> ⚠️ If testing locally before publishing to Packagist, add a `repositories` entry in your `composer.json` pointing to the local path.

---

### Step 3 — Setup Database (XAMPP + phpMyAdmin)

[](#step-3--setup-database-xampp--phpmyadmin)

1. **Start XAMPP** — enable both **Apache** and **MySQL**
2. **Open phpMyAdmin** at `http://localhost/phpmyadmin`
3. **Create a new database** named:

```
email_channel_db

```

---

### Step 4 — Configure `.env`

[](#step-4--configure-env)

Open `email-channel-app/.env` and set the following:

#### 🗄️ Database

[](#️-database)

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=email_channel_db
DB_USERNAME=root
DB_PASSWORD=
```

#### 📥 IMAP — Incoming Emails

[](#-imap--incoming-emails)

```
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
IMAP_ENCRYPTION=ssl
IMAP_USERNAME=your-email@gmail.com
IMAP_PASSWORD=your-app-password
```

> ⚠️ Use an **App Password**, not your Gmail account password.
> Don't forget to **enable IMAP** in Gmail Settings → See all settings → Forwarding and POP/IMAP.

#### 📤 SMTP — Sending Emails

[](#-smtp--sending-emails)

```
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@gmail.com
MAIL_FROM_NAME="Email Channel"
```

---

### Step 5 — Run Migrations

[](#step-5--run-migrations)

```
php artisan migrate
```

This creates the following tables:

- `messages`
- `message_metas`

---

### Step 6 — Setup Scheduler (Auto Fetch)

[](#step-6--setup-scheduler-auto-fetch)

Open `bootstrap/app.php` and add the following **before** `->create()`:

```
->withSchedule(function ($schedule) {
    $schedule->call(function () {
        app(\Arkadip\EmailChannel\Services\ImapService::class)->fetchEmails();
    })->everyTenSeconds(); // near real-time fetching
})
```

Then start the scheduler:

```
php artisan schedule:work
```

---

### Step 7 — Setup Routes

[](#step-7--setup-routes)

Open `routes/web.php` and add:

```
use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('email-channel::dashboard');
});
```

---

### Step 8 — Run the Application

[](#step-8--run-the-application)

```
php artisan serve
```

Visit: ****

---

🎯 Testing Features
------------------

[](#-testing-features)

FeatureDescription✅ **Send Email**Use the dashboard form — sent via SMTP and stored in DB✅ **Receive Email**Fetched via IMAP, stored in DB, duplicates prevented✅ **Auto Fetch**Scheduler runs automatically, only fetches new emails✅ **Real-time UI**Dashboard auto-updates via polling---

📦 API Endpoints
---------------

[](#-api-endpoints)

MethodRoutePurpose`GET``/email-channel/emails`Retrieve stored emails`POST``/email-channel/send`Send an email`POST``/email-channel/fetch`Trigger a manual fetch`GET``/email-channel/dashboard`View the dashboard UI---

🧠 Key Concepts
--------------

[](#-key-concepts)

### 🔁 Incremental Fetch (UID-based)

[](#-incremental-fetch-uid-based)

Rather than re-fetching all emails on every run:

- ✔ Only **new emails** are fetched
- ✔ Uses **UID tracking** to resume from last position
- ✔ Efficient and scalable for production use

### 🔐 Security Best Practices

[](#-security-best-practices)

- Never expose your `.env` file
- Always use **App Passwords** for Gmail
- Do not commit credentials to version control

---

⚠️ Common Issues
----------------

[](#️-common-issues)

**❌ Emails not fetching**- Enable IMAP in Gmail Settings
- Use an App Password, not your account password
- Double-check IMAP credentials in `.env`

**❌ MySQL not starting**- Restart XAMPP
- Check for port conflicts (default: 3306)
- Fix corrupted tables via phpMyAdmin if needed

**❌ Package not found**```
composer dump-autoload
composer update
```

**❌ Scheduler not running**```
php artisan schedule:work
```

---

🗒️ Notes
--------

[](#️-notes)

- Package is **auto-discovered** by Laravel — no manual provider registration needed
- Views are **optional** and fully customizable
- Scheduler is controlled entirely by the host application

---

✅ Final Result
--------------

[](#-final-result)

> A fully working email system with Laravel package integration, real-time email fetching, and a clean modular architecture.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

93d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f563e3d1ec0a5a1ee56719423293284ed40b48ce100b21a3b4dc2164416c2181?d=identicon)[Arkadipttv](/maintainers/Arkadipttv)

---

Top Contributors

[![Arkadipttv](https://avatars.githubusercontent.com/u/138896045?v=4)](https://github.com/Arkadipttv "Arkadipttv (5 commits)")

### Embed Badge

![Health badge](/badges/arkadip-email-channel/health.svg)

```
[![Health](https://phpackages.com/badges/arkadip-email-channel/health.svg)](https://phpackages.com/packages/arkadip-email-channel)
```

###  Alternatives

[mattketmo/email-checker

Throwaway email detection library

2752.1M5](/packages/mattketmo-email-checker)[sarfraznawaz2005/noty

Laravel package to incorporate noty flash notifications into laravel.

324.5k](/packages/sarfraznawaz2005-noty)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
