# Could not find SwiftMailer

**URL:** <https://community.openenergymonitor.org/t/could-not-find-swiftmailer/2170>\
**Category:** Emoncms\
**Tags:** support\
**Created:** [11 November 2016 10:40 UTC](https://community.openenergymonitor.org/t/could-not-find-swiftmailer/2170 "2016-11-11T10:40:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [11 November 2016 17:12 UTC](https://community.openenergymonitor.org/t/could-not-find-swiftmailer/2170/2 "2016-11-11T17:12:12Z")

</div>

Do you have Swiftmailer installed?

```auto
pear channel-discover pear.swiftmailer.org
pear install swift/swift

```

I had the same issue, even with it installed and found editing emoncms/Lib/email.php sorted it for me.

> <https://github.com/emoncms/emoncms/blob/master/Lib/email.php#L16>

I found the `swift_required.php` file was not in the `Swift` folder but on the same level as it

```auto
pi@emoncmsPi: $ ls -la /usr/share/php/{Swift*.*,swift*.*,Swift/Swift*.*}
-rw-r--r-- 1 root root 735 Jun 13 18:20 /usr/share/php/swift_init.php
-rw-r--r-- 1 root root 2110 Jun 13 18:20 /usr/share/php/Swift.php
-rw-r--r-- 1 root root 693 Jun 13 18:20 /usr/share/php/swift_required.php
-rw-r--r-- 1 root root 536 Jun 13 18:20 /usr/share/php/Swift/SwiftException.php

```

so by changing

```auto
$this->have_swift = @include_once ("Swift/swift_required.php");

```

to

```auto
$this->have_swift = @include_once ("swift_required.php");

```

seemed to do the job.

However I cannot say if that is a “good fix” or not, I’m not good with PHP and I find that piece of code a bit confusing as [the following couple of lines](https://github.com/emoncms/emoncms/blob/master/Lib/email.php#L18-L19) seem to be a fall back for when “pear” swift isn’t installed, it appears to want to resort to using `emoncms/Lib/swiftmailer/swift_required.php` which doesn’t exist and presumably therefore doesn’t work.

---

_[View the full topic](https://community.openenergymonitor.org/t/could-not-find-swiftmailer/2170)._
