how to use an alarm to trigger an email


Ampm

Recommended Posts

I believe you would add something like this to your "Fire Event" tab under the alarm.

if(Alarm.YourAlarm.Fired)
   email.strHost = "smpt.comcast.net" //Your outgoing mail host.
   email.strUserName = "xxx@comcast.net" //username
   email.strPassword = "xxxx" //password
   email.strTo = "yyyy@email.com" //email to send to
   email.strReplyAddress = "xxx@comcast.net" //your email
   email.strSubject = "This is a test email!" //subject
   email.strFile = "c:\thefileyouwanttoattch.txt" //if you want to attch a file
   email.Port = "587" //comcast just changed their port to this, make sure this is correct or it wont send!
   email.strAuthenticate = "NoLogin" //may have to change this based on YOUR settings
   email.Send() //finally!
endif

The help section, 12.3, covers ALL of this. :D

Please correct me if I'm wrong AzeoTech! :)

Link to comment
Share on other sites

That is almost right, but there is no reason for the if(Alarm...) since this event on triggers when the alarm actually fires.

Also BeeHay, be careful about posting code directly out of your app. I went through and cleared out your email info. You left enough that a spammer could utilize your account.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.