retrieve pop3 email

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

retrieve pop3 email

Post by TakeFlight »

Has anybody come up with a way to retrieve their pop3 email using HouseBot? Presumably with a vbscript. Useful things that could be done with this would be...



-activate tasks based on commands received via email

-read your email via text to speech

-read your email on a software remote or at the very least display how many emails are currently in your pop3 account

-alert you when new mail arrives via software remote, text to speech, etc.



I'm sure there would be other great reasons to be able to retrieve pop3 email as well.
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post by TakeFlight »

Another idea would be to email HouseBot with a specific command that would in turn initiate a Task that sends an email back to me with various status information regarding devices, etc. Sure, I could configure a timed task that could do this from time to time. But, I think it would be better to be able to initiate this when I need it. So, you could be at work or on vacation or whatever and send an email to HouseBot and then it would essentially reply back with status information. This could be security/alarm sensor stats, light on/off stats, temperature readings, system stats or whatever.



From browsing the Homeseer message forum (which I do on a regular basis just beause there is a lot more activity over there) it appears Homeseer has email receiving functionality (or somebody wrote a script) based on comments I've seen. I'm surprised nobody has responded to this message. I would think this would be a popular feature. Maybe not. :)
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Post by PT »

Hi Takeflight



Yes this would indeed be good feature.An email reader would be very useful for at least notifying remotes.The ability for housebot to act on email would also enhance its usability.

Below is some code which allows access to Outlook via vbscript this could form the basis of what you require.







Set appOutl = Wscript.CreateObject("Outlook.Application")

Set objSession = appOutl.GetNameSpace("MAPI")

objSession.Logon "Outlook"



' 3 = "Deleted Items"

' 4 = "Outbox"

' 5 = "Sent Items"

' 6 = "Inbox"

' 9 = "Calendar"

' 10 = "Contacts"

' 11 = "Journal"

' 12 = "Notes"

' 13 = "Tasks"

' 15 = "Reminders"

' 16 = "Drafts"



' *** INBOX folder

Set MyFolder = objSession.GetDefaultFolder(6)

Msgbox MyFolder.name & ", " & MyFolder.Items.Count



' Set MyItem to the collection of items in the folder.

Set myItems = myFolder.Items

' Loop through all of the items in the folder.

For I = 1 to MyFolder.Items.Count

MsgBox MyItems(I).subject

MsgBox MyItems(I).body

Next



' *** Contacts Folder

Set MyFolder = objSession.GetDefaultFolder(10)

Msgbox MyFolder.name & ", " & MyFolder.Items.Count

Set myItems = myFolder.Items.Restrict("[MessageClass] = 'IPM.Contact'")

For I = 1 to MyFolder.Items.Count

MsgBox MyItems(I).FullName

Next
Regards

PT

If it isn't broke,fix it till it is!
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Richard Naninck also wrote something to do this. Not sure if it would fit what you are looking for or if you can adapt it, but the post about it is here.
Scott
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post by TakeFlight »

PT:



Thanks for the info. I probably would want to do this directly via pop3 and not have to interface with Outlook. Although, you never know when interfacing with Outlook might be useful. Maybe pulling calender info for text to speech reminders. :)
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post by TakeFlight »

ScottBot:



Thanks, I somehow missed that post. That sounds like exactly what I'm looking for.
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Post by PT »

I have seen Richards screenshots and it does look good.I believe he is refining an adding functionality at the mo.

So wait a while and he may be able to help.
Regards

PT

If it isn't broke,fix it till it is!
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Post by PT »

Actually thinking a bit further. I use a fax to email/email to fax gateway at work( the same with my mailserver).This has the ability to change settings via the subject header.So with a little thought a message could be parsed and the subject heading used to populate a null device and a task actuated... etc Sending an email via script/outlook is fairly straightforward :?
Regards

PT

If it isn't broke,fix it till it is!
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

Indeed I wrote an email script that can do exactly what is requested above. By having email information about the sender, subject etc it is very easy to trigger events upon received subjects.



I just finished a Schedular vbscript that works as a cellular phone calendar. Just input some birthdays, alarm clocks, appointments etc and you will be notified by icons and list views when the items have passed in time. Adding, changing and deleting items is all done from the SWRemote which is of course touch screen optimized. I am now thinking about what kind of alarms I want these events to have. Maybe sending an SMS if somebody's birthday is up would be a nice approach or I could just turn on my receiver to act as an alarm clock.

Items can have a repeat option such as: None, 1 hour, 1 day, 1 week, 2 weeks, 1 month and 1 year. If an event is passed and cleared from within the GUI, the next event is saved in the list specified by the repeat option that was set.
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post by TakeFlight »

Sounds like you've been working on a number of things that I have on my list of things I'd like to be able to do with HB. I was intending on writing a script to use for reminders (birthdays, appointments, etc) at some point in the future. That's awesome that you've got it to the point of being able to enter data via the swremote as well!
PT
Senior Member
Posts: 147
Joined: Wed Apr 13, 2005 12:32 pm
Location: Hampshire.UK

Post by PT »

Hi all,

Takeflight some activity for you!



I have looked at the email sender within Housebot and I cannot use due to my provider requiring SMTP authentication.

So I revisited Outlook and found that the object model can be addressed as per my previous note. However this does bring the pop up screen" another prgram is trying to access etc". This requires user intervention.

There is a program called redemption which allows you to access outlook info without this message.



So the following script now works for sending housebot info



Set Application = CreateObject("Outlook.Application")

Set Namespace = Application.GetNameSpace("MAPI")

Namespace.Logon "Outlook"

strproperty =GetPropertyValue("TemperatureSensor1.Temp display")



dim SafeItem, oItem

set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem

set oItem = Application.CreateItem(0) 'Create a new message

SafeItem.Item = oItem 'set Item property

SafeItem.Recipients.Add "[email protected]"

SafeItem.Recipients.ResolveAll

SafeItem.Subject = "Testing Redemption"

SafeItem.HTMLBody = "Temperature"&vbcrlf& ":"& strproperty

SafeItem.attachments.Add"C:\test.txt"

SafeItem.Send



I have left the attachments bit in so you send a log file etc.



My next post will ask a question which will help with the other part of the task which is getting outlook to activate the sending of this script.

I presently use rules(in oulook) to activate a bat file which sends the following command

C:\HB_Control.exe /I 192.168.1.30 /O 8100 /S password /C SPV /D "emailout" /P "Message" /V Yes

this uses the com control to make housebot send the info.

It works but I would like to send a vbs script.
Regards

PT

If it isn't broke,fix it till it is!
TakeFlight
Member
Posts: 53
Joined: Wed Feb 01, 2006 11:48 pm
Location: Philly burbs

Post by TakeFlight »

Wow, it's a regular flurry of activity. :)



Looks good. I still say for my purposes (at least for now) I'm not looking to integrate with Outlook.



But, the more info available on this forum the better. I believe a number of people are probably working on HB projects and not really contributing much on the forum. That's certainly their prerogative, but it would be nice to share ideas, scripts etc. whenever convenient (as you have done). I've shared some ideas and things that I've done in various threads and I plan to continue to do so as I see fit.
Post Reply