PHPackages                             taitava/silverstripe-sentemails - 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. taitava/silverstripe-sentemails

ActiveSilverstripe-vendormodule[Mail &amp; Notifications](/categories/mail)

taitava/silverstripe-sentemails
===============================

A module that allows saving sent email message to an IMAP server.

1.0.2(7y ago)112MITPHP

Since Apr 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Taitava/silverstripe-sentemails)[ Packagist](https://packagist.org/packages/taitava/silverstripe-sentemails)[ RSS](/packages/taitava-silverstripe-sentemails/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

taitava/silverstripe-sentemails
===============================

[](#taitavasilverstripe-sentemails)

This is a module that wraps around [taitava/swiftmailer-imapsentfolder](https://github.com/Taitava/swiftmail-imapsentfolder) to provide an ability to store any email messages sent from your SilverStripe website/application to an IMAP email server.

It's quite simple and lightweight.

Requirements
------------

[](#requirements)

- SilverStripe framework version 4
- PHP imap extension
- SwiftMailer must be used as the mailer (SilverStripe uses this by default)
- **An IMAP email account.** No other protocols are supported.

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

[](#installation)

`composer require taitava/silverstripe-sentemails`

Usage
-----

[](#usage)

Create a new file `app\_config\sentemails.yml`:

```
Taitava\SentEmails\ImapSentFolderFactory:
  mailboxes:
    default:
      host: imap.somedomain.tld
      port: 993
      sent_folder: Sent
      username: 'email.address'
      password: 'verysecretdonotsharepubliclyintheinternet'
    'email.address@somedomain.tld':
      host: imap.somedomain.tld
      port: 993
      sent_folder: Sent
      username: 'email.address'
      password: 'verysecretdonotsharepubliclyintheinternet'
```

Then run `dev/build?flush=all` in your browser. Done! All emails that your application sends will now be saved!

The module will automatically pick the correct mailbox by inspecting the 'From' field from the email message that was sent. If the email address is not found from the `mailboxes` configuration, the module will use the mailbox defined with the key 'default'. You should always define a default mailbox if its possible that mail is sent from unforeseen email addresses!

Control what gets saved and what not
------------------------------------

[](#control-what-gets-saved-and-what-not)

Sometimes you want to examine the sent email messages and make a decision whether it should be saved or not. There is a flexible way to do this by creating a subclass of the SilverStripe's `Extension` class:

```
use SilverStripe\Core\Extension;

class MyImapSentFolderFactoryExtension extends Extension
{
        public function onBeforeSaveEmailMessage(Swift_Mime_Message $email_message)
        {
                // ... Inspect the $email_message instance ...

                // ... Decide not to save this message ...
                return false;

                // ... Decide to accept saving the message ...
                return true;

                // ... If you do not write a 'return' statement or if you return null, saving is also accepted ...
                return;
        }
}
```

Now we just need to enable our new extension. Append this to `app\_config\sentemails.yml`:

```
Taitava\SentEmails\ImapSentFolderFactory:
  extensions:
    - MyImapSentFolderFactoryExtension
```

**Pro tip**: As far as I know, there is no extension hook in SilverStripe's `Email` or `SwiftMailer` classes that could be easily used to trigger code *after sending an email*. (Usually you are required to write your own plugin for SwiftMail). If you need this kind of extension hook for whatever reason, you can use an extension like the one described here. Just return `false` whenever you don't need the sent message to be saved.

Future
------

[](#future)

Ideas (and pull requests) are welcome :). No big plans at the moment, I'm considering this plugin quite complete. But will try to fix issues if any arise.

Author
------

[](#author)

Oh, it's just me. Too lazy to write my name. :)

License
-------

[](#license)

MIT

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~4 days

Total

3

Last Release

2590d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/611d4d836f6db7ba7357ea174bf48ab8cf86af5ac40be4a7a6101e67267333f9?d=identicon)[taitava](/maintainers/taitava)

---

Top Contributors

[![Taitava](https://avatars.githubusercontent.com/u/13002142?v=4)](https://github.com/Taitava "Taitava (3 commits)")

---

Tags

emailimapsent

### Embed Badge

![Health badge](/badges/taitava-silverstripe-sentemails/health.svg)

```
[![Health](https://phpackages.com/badges/taitava-silverstripe-sentemails/health.svg)](https://phpackages.com/packages/taitava-silverstripe-sentemails)
```

###  Alternatives

[ddeboer/imap

Object-oriented IMAP for PHP

9153.9M11](/packages/ddeboer-imap)[tedivm/fetch

A PHP IMAP Library

5061.2M8](/packages/tedivm-fetch)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

23125.7k2](/packages/henrique-borba-php-sieve-manager)[benhall14/php-imap-reader

A PHP class that makes working with IMAP in PHP simple.

3516.6k](/packages/benhall14-php-imap-reader)[tedivm/dovecottesting

An IMAP Testing Suite

312.2k7](/packages/tedivm-dovecottesting)

PHPackages © 2026

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