I saw some other older threads on this, but I am hoping either I am doing something wrong, or there is a way around to do what I am looking to do. is hs.mailtrigger still broken in HS3? How are others parsing emails that are received? I get email alerts from my NVR that I want to parse out so I can get alerts when things are down.
Here is the script I am testing with and it's output. It would seem I get the email #, but none of the data populates:
Here is the script I am testing with and it's output. It would seem I get the email #, but none of the data populates:
Code:
Class email_test
Public Sub Main(ByVal parms As Object)
Dim index As Integer
Dim subject_line As String
Dim from_line As String
Dim Count As String
index = hs.MailTrigger
subject_line = hs.MailSubject(index)
from_line = hs.MailFrom(index)
Count = hs.MailMsgCount()
hs.SetDeviceString(2305, subject_line, True)
hs.WriteLog("Email Test", "Index: " & index & " From: " & from_line & " Subject:" & subject_line & " Unread: " & Count)
'parse the body here and do what you want to do with the data
End Sub
End Class
Code:
Email Test
Index: 54 From: Subject: Unread: 55