Sendmail - Send email and text notifications, (notification device) no local server needed

Thanks for responding. Wanting to do a new install.

ok first install the hubitat package manager app,
then once installed use that to search for sendmail, and let it install sendmail

they you add a new device under devices for sendmail.

then configure your mail server, port (default 25) and user name and password if needed.. but what mail server are you planning on using as the app does not support encryption.

I thought I read a way to use Gmail?

nope .. years ago before they required tls or ssl or using an intermediary server like on your nas.

Part of the reason for my inquiry as not sure what is current and correct. What are some easy ways to do this? Thanks for the help!

I am actually working on extending my Google Calendar Search application to include a Gmail notification device option as well as email searching capabilities. This solution will not require a middle man mail server and your hub will work directly with the Google API's to send the email.

I should have a version posted this week. I will tag you once I get it released so you are aware. The Google API setup can be a bit tricky but once setup you shouldn't have to mess with it again.

2 Likes

Excellent! I look forward to another great addition!

1 Like

I just uploaded v3.5.0 that adds Gmail notification capabilities to this app.

3 Likes

Congrats on the new release with Gmail added.

3 Likes

Hi, it appears that all SMTP sources I have (cox.net, live.com) need encryption (TLS?), any suggestions on that "intermediary" service I could use - Free is best. :slight_smile:

I'd read the thread, but it works perfectly. :slight_smile:

Something about HPM. Perhaps one day.

If you can't use Sendmail, then as posted just above, @ritchierich's integration supports notifications via Gmail. Also works very well.

1 Like

Thanks. I'll try again, but I thought I tried all possible settings/ports/options. I probably got something wrong for my particular setup..

This is the log when it expires after the three retries.

Is there a way to change the Subject in the message that you set in the device so that I could use the 1 SendMail device for many notices?

I could not find a way in webCore or RM

The system notification call has no option for that. The only thing i can think of is a custom attribute you could set in a rule before sending the notification. But this would only work in std rule machine as other methods would not be able to do it. Not sure of the benefits.

In the other app that lets you send email (via Gmail), you can set a per-message Subject: by prefixing the message with "Subject:" and ending the subject with a comma.

E.g., "Subject: this is the subject,This is the body"

(@kahn-hubitat if you implement something, I'd suggest you make it compatible with that)

1 Like

Correct. @kahn-hubitat I have an if statement in my code that looks for this condition:

if (message.startsWith("Subject:") && message.indexOf(",") > -1) {
  def messageSplit = message.split(",")
  subject = messageSplit[0].replace("Subject:", "")
  message = messageSplit[1].trim()
}

Maybe you can do something similar.

4 Likes

Good idea i will look at implementing that.

3 Likes

Just in case you want to see the entire code its in the sendMessage function starting on line 1147:

Basically the subject gets passed into this function which defaults to the setting value on the child notification device and this code will overwrite it if the subject keyword is included in the message.

2 Likes

I am going to generalize that concept. But with a specific order caveat.

To: first
Cc: 2nd
Subject: third

If you put them in that order i think i could implement the capability to change all of them.

4 Likes