# Call to undefined method setApiKey

**URL:** https://forum.mautic.org/t/call-to-undefined-method-setapikey/7563
**Category:** Product Support
**Created:** [February 16, 2017, 4:44pm UTC](https://forum.mautic.org/t/call-to-undefined-method-setapikey/7563 "2017-02-16T16:44:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![andreambrosio](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@andreambrosio](https://forum.mautic.org/u/andreambrosio)
#### Post date: [February 16, 2017, 4:44pm UTC](https://forum.mautic.org/t/call-to-undefined-method-setapikey/7563/1 "2017-02-16T16:44:22Z")

</div>

I am trying to connect the mautic to elastic email, but this error message appears in the log and does not succeed. Does anyone know how to solve it?  
  
Thanks

Code:

[2017-02-16 13:40:31] mautic.ERROR: PHP Error - Call to undefined method setApiKey - in file /home/ideacomu/public\_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] [] [2017-02-16 13:40:46] mautic.ERROR: PHP Error - Call to undefined method setApiKey - in file /home/ideacomu/public\_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] []

---

<div class="post-metadata">

### Author: ![andreambrosio](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@andreambrosio](https://forum.mautic.org/u/andreambrosio)
#### Post date: [February 16, 2017, 4:44pm UTC](https://forum.mautic.org/t/call-to-undefined-method-setapikey/7563/2 "2017-02-16T16:44:22Z")

</div>

I am trying to connect the mautic to elastic email, but this error message appears in the log and does not succeed. Does anyone know how to solve it?  
Thanks

`[2017-02-16 13:40:31] mautic.ERROR: PHP Error - Call to undefined method setApiKey - in file /home/ideacomu/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] []
[2017-02-16 13:40:46] mautic.ERROR: PHP Error - Call to undefined method setApiKey - in file /home/ideacomu/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] []
`
