# Not able to use sendMail in 1.7.1

**URL:** <https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781>\
**Category:** Beginners\
**Tags:** smtp, beginners\
**Created:** [September 25, 2015, 1:01am UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781 "2015-09-25T01:01:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddykeman](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@ddykeman](https://community.openhab.org/u/ddykeman)\
**Post date:** [September 25, 2015, 1:01am UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781/1 "2015-09-25T01:01:50Z")

</div>

Hello all,

I have read and tried the other solutions for this error message,

**Error during the execution of rule ‘send email’: The name ‘sendMail(,,)’ cannot be resolved to an item or type.**

I have tried every combination of configuration settings with no luck. including port 25 & 587 with TLS both on and off these are my current settings… Can someone please verify these are correct for gmail? is there other configuration or rules I’m missing?

import org.openhab.core.library.types.\*  
import org.openhab.core.persistence.\*  
import org.openhab.model.script.actions.\*

mail:hostname=[smtp.gmail.com](http://smtp.gmail.com)  
mail:port=25  
[mail:username=xxxxxx@gmail.com](mailto:mail:username=xxxxxx@gmail.com)  
mail:password=xxxxxx  
[mail:from=dave.dykeman@gmail.com](mailto:mail:from=dave.dykeman@gmail.com)  
mail:tls=false

Thanks for any help you can give… Dave

---

<div class="post-metadata">

**Author:** ![ben\_jones12](https://community.openhab.org/user_avatar/community.openhab.org/ben_jones12/32/52_2.png) [@ben\_jones12](https://community.openhab.org/u/ben_jones12)\
**Post date:** [September 25, 2015, 4:56am UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781/2 "2015-09-25T04:56:58Z")

</div>

Have you got the mail action bundle in your \addons directory?

---

<div class="post-metadata">

**Author:** ![ddykeman](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@ddykeman](https://community.openhab.org/u/ddykeman)\
**Post date:** [September 25, 2015, 5:30am UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781/3 "2015-09-25T05:30:11Z")

</div>

Hey Ben,

I have these 2 bundles which seen to be related to mail “org.openhab.binding.mailcontrol-1.7.1.jar” and “org.openhab.action.mail-1.7.1.jar”

Are both required ? or just “org.openhab.action.mail-1.7.1.jar”? assuming this is the mail action bundle you’re talking about.

Are there any other prerequisites?

Thanks for the reply Dave

---

<div class="post-metadata">

**Author:** ![dmasyukov](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/50afbb/32.png) [@dmasyukov](https://community.openhab.org/u/dmasyukov)\
**Post date:** [October 6, 2015, 4:29am UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781/4 "2015-10-06T04:29:35Z")

</div>

Just org.openhab.action.mail-1.7.1.jar is what’s needed for “sendMail” to work.  
There is also no need for any imports in your rule.

Maybe a restart is required? Or did you resolve the issue?

---

<div class="post-metadata">

**Author:** ![ddykeman](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@ddykeman](https://community.openhab.org/u/ddykeman)\
**Post date:** [October 7, 2015, 6:57am UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781/5 "2015-10-07T06:57:16Z")

</div>

I reinstalled openHAB and the addon’s and working now. Thanks for the info in the imports. Is what cases are these required?

Thanks Dave

---

<div class="post-metadata">

**Author:** ![dmasyukov](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/50afbb/32.png) [@dmasyukov](https://community.openhab.org/u/dmasyukov)\
**Post date:** [October 7, 2015, 2:33pm UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781/6 "2015-10-07T14:33:57Z")

</div>

Honestly, I don’t even know when they are required. I heard that some very common ones are imported automatically, but something like Joda time, I think, require an explicit import. First I add all imports that I can think of, and then I remove them and check if rule is still working.

---

<div class="post-metadata">

**Author:** ![ddykeman](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/58956e/32.png) [@ddykeman](https://community.openhab.org/u/ddykeman)\
**Post date:** [October 7, 2015, 2:48pm UTC](https://community.openhab.org/t/not-able-to-use-sendmail-in-1-7-1/2781/7 "2015-10-07T14:48:20Z")

</div>

Thank you Denis!
