Premise SMS

  • Thread starter Thread starter chucklyons
  • Start date Start date
Motorola Premise
C

chucklyons

Guest
Email is nice, especially when you're trying to keep tabs on how well Premise is doing, I really just want a notice on my phone...well, maybe you guys know/knew the secret of sending text messages from Premise...but as I was trying to figure out how to do it, I came upon this..

Sending SMS From Premise

It works and given the wide variety of gateways, you should be able to find something that works for you....
 
Thanks Chuck. I figured this was posible, but I never spent the time to figure it out. I'll try it this weekend.
 
Code example that seems to work for me using wowway on a PC that does NOT have outlook or outlook express set up.

If you have the smtp service set up (ie outlook or etc are working), I think you can use simpler code and don't have to bother with the smtp, username, etc...

Who ever uses this needs to change the stuff in caps. My carrier is sprint, but if your's isn't you'll have to follow Chuck's link to get the correct address.

This function is passed an event.
Code:
function gNotifyMe(oEvent)
	set oLinked = oEvent.linkObject
	if not oLinked is nothing then
		sLinkPath = oLinked.path
	else
		sLinkPath = "no linkobject"
	end if

	set oEmail = createObject("CDO.Message")
	oEmail.From = "[email protected]"
	oEmail.To = "[email protected]"
	oEmail.Subject = oEvent.Name & " occurred at: " & oEvent.EventTime
	oEmail.Textbody = oEvent.Description & vbcrlf & sLinkPath & vbcrlf & oEvent.EventTime
	with oEmail.Configuration.Fields
		.Item("http://schemas.microsoft.com/cdo/configuration/nntpauthenticate") = 1
		.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTPSERVERADDRESS.com"
		.Item("http://schemas.Microsoft.Com/cdo/configuration/sendusername") = "USERNAME"
		.Item("http://schemas.Microsoft.Com/cdo/configuration/sendpassword") = "PASSWORD"
		.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
		.Update
	end with
	oEmail.Send
	set oEmail =  nothing
end function

For example if you have a thermostat or temperature sensor you would call the event then email it like this:
Code:
if (sysevent.newVal*(9/5)-459.67)< 39 then
	'Set event
	set objEvent = Events.CreateObject(Schema.System.Event.Path, "Indoor temp low")
	objEvent.Description = "Inside temperature is at: " & round(this.Temperature.Fahrenheit,1) & "F"
	'Gives Event a Severity Level To check against.
	objEvent.Severity = 50
	'Gives EventTime property the current system time.
	objEvent.EventTime = now
	'Sets the Event LinkObject
	objEvent.LinkObject = this
	'Email me event
	gNotifyMe(objEvent)
	set objEvent = nothing
end if
 
Thanks for this! I have been successful, as well, without OutLook/Express (I use Desknow). One problem I have had, and haven't figured out is multiple recipients.

"[email protected]; [email protected]"

I thought the ; was the right method - no luck (tried commas, etc)

Any thoughts on this one?
 
Hmm... I thought I had a used semi-colon in a MS Access email vbscript before?!?

Can you use oEmail.CC for the other email address?

BTW, if anyone uses the code above, it will not work if your ISP uses SSL. If you google CDO.Message gmail, you'll see several good examples of how to modify the code for SMTP servers that require SSL. Also, use the sending email address and smtp server provided by your ISP; else your messages could get blocked.

Thanks for this! I have been successful, as well, without OutLook/Express (I use Desknow). One problem I have had, and haven't figured out is multiple recipients.

"[email protected]; [email protected]"

I thought the ; was the right method - no luck (tried commas, etc)

Any thoughts on this one?
 
Well, I'm not sure whether it is a DeskNow nuance or my lack of SMTP experience, but the solution I came up with works...it's called a 'mailing list' ;) Now I get an text message AND an email...
 
I know this should be easier...I have two events, filter on (StartTime), filter off (EndTime). I want to take the time of each event, subtract starttime from endtime, and then use the time to get sent in an email as 'filter ran for 'n' minutes'.

I'm use raise.exception and get event notifications for StartTime and EndTime, as I should.

However, I haven't been able to get DiffDate to work to save my life 'DiffDate("s", StartTime, EndTime)'

Any ideas?
 
VBScript's DateDiff function finds the time difference between two dates where each date contains the year, month, day, and time (i.e. 01/12/2010 12:45:00 PM).

DateDiff will be unhappy if StartTime and EndTime only contain the time-of-day (i.e. 12:54 PM).

A quick fix is to append the current date to each time (not a good solution if EndTime lands on the next day):
DateDiff("s", Date & " " & StartTime, Date & " " & EndTime)

Alternately, redefine StartTime and EndTime so that they contain the full date and time.
 
Back
Top