Page 1 of 2

Email verification on free email accounts???

Posted: Tue Feb 26, 2008 1:29 pm
by James D
Can HB send email verification from an free email account such as Gmail, Hotmail, or Yahoo? I see that HB is looking for port 530. These free email acounts use ports 25 and 465. Is it possible to send email without 3rd party program such as Outlook, and Outlook Express, etc.?

Posted: Tue Feb 26, 2008 3:10 pm
by Osler
Check the SMTP COM object by ostrosoft. Free to use for non-commercial stuff and works very well. Just drop it into a vbscript and it should do whatever you want. I haven't played with it in a while but was using it with Yahoo previously.

http://www.ostrosoft.com/smtp_component.asp

Osler

Posted: Tue Feb 26, 2008 4:11 pm
by James D
So there is no way around but to use a 3rd party program. I might just have to use Outlook or Outlook Express. All I am trying to do is send my home selected SMS messaged from my cell phone to my Home's Selected email. Execute the task then have my home reply back to my cell phone (SMS Message) since I have Unlimited Texting. LOL. Gotta keep those cost down. Also the scripts I have seen on the HB forum are not working for me, right off the bat. I am getting an "Error:0 "Object required: "Wscript" error. when i change the state of my script file to Running. I used the below script:

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

Please remember I am new to scripting. I can figure it out but it will take a while. Is the above script written for Outlook Express or only Outlook?

Posted: Tue Feb 26, 2008 4:30 pm
by James D
I also found this email retrieval from Outlook.
' ========================================================================
' script for e-mail subject check
' it will check the subject of unread emails in Outlook. If it has the right info
' in the subject it will take action and then delete e-mail.
' you must have outlook to automatically check email every xx minutes and then
' create a task to run this script every xx minutes.
' ========================================================================

Dim myOlApp
Dim intMessCount , intMyFoldersCount
Dim myFolder
Dim x
Dim UnRead
Dim objMessage
Dim objMessages
Dim objFolder
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder= myNameSpace.GetDefaultFolder(6)

UnRead=0
intMessCount = myFolder.Items.Count
SetPropertyValue "email.subject", ""

For x = 1 To intMessCount
myUnread = myFolder.Items(x).UnRead
If myUnread = True Then

'check for this title as the subject

If myFolder.Items(x) = "Disarm Security System" Then
SetPropertyValue "Security System Status.System Status", "Disarmed"
SetPropertyValue "email.subject", myFolder.Items(x)
myFolder.Items(x).Delete
UnRead = UnRead - 1
End If
UnRead = UnRead + 1
End If
Next
SetPropertyValue "email.UnRead", UnRead

Posted: Tue Feb 26, 2008 7:52 pm
by Osler
There is no WScript object in HouseBot. Try just using:

Code: Select all


Set x = CreateObject("Outlook.Application")

Osler

Posted: Wed Feb 27, 2008 8:49 am
by Richard Naninck
I just went through a complete ostrosoft pop3 script install with Steve. It provides a fully integrated email option with HouseBot. Right now it receives and deletes mail upon request, but with the correct scripting additions you can send messages as well.

Not sure what you want to do, but couldn't you just get the text out of your mail and forard it using the built in email device?

Olser is right about the WScript. Just leave that away and it should work.

Posted: Wed Feb 27, 2008 8:50 am
by James D
I am soo stupid, I just clicked on the script in explorer and Outlook can up.

Pretty simple. I just will have to figure out how to impliment it into my HB configuration.

Posted: Wed Feb 27, 2008 10:32 am
by James D
Is there a way i can change the ports in SMTP HB?

Posted: Wed Feb 27, 2008 9:10 pm
by ScottBot
James D wrote:Is there a way i can change the ports in SMTP HB?
No there isn't.

Posted: Thu Feb 28, 2008 1:01 am
by James D
Hey Richard,

Do you have the ostrosoft script that you and Steve worked on. Or can you tell me where on the forum it is, if it there. Any Help will be appreciated.

Thanks

Posted: Thu Feb 28, 2008 3:17 am
by Richard Naninck
James,

Steve has it all and I don't have the time right now because these things take up lots of emails and amongst other things, my system is going down to get the hardware replaced. Maybe Steve is willing to help you on this one. Otherwise you have to wait until after the beginning of april.
Good luck.

Posted: Thu Feb 28, 2008 8:59 am
by Steve Horn
Richard did all the work. He sent me his email app's pieces, I made very minor changes (mostly to removes some of the Dutch in the message strings), and make it a little more generic - less tied to his HB theme. I can send you his original zip file, or the result of what little I put into it. I made no changes to the POP portion - that's all turnkey. I went thru several iterations getting it to install and work, mostly due to my blunders. But its functioning now in its more generic form.

Posted: Thu Feb 28, 2008 11:42 am
by Osler
You can try this for outgoing messages. Hotmail only uses HTTP and Google uses SSL encryption so I'm pretty sure Yahoo is going to be your best bet. I haven't tested the script below as I have firewall issues at work, but it should function correctly. I can walk you through any difficulties as needed.

Modified from Ostrosoft sample vbscript:

Code: Select all

'VBScript sample for OstroSoft SMTP Component
'written by Igor Ostrovsky (OstroSoft)
'
'Permanent URL for this project is
'http://www.ostrosoft.com/smtp_component/smtp_vbscript.asp
'
'For more information about OstroSoft SMTP Component go to
'http://www.ostrosoft.com/smtp_component.asp
'
'OstroSoft SMTP Component is available for download at
'http://www.ostrosoft.com/download/smtp_component.zip
'
'Questions, suggestions, comments - email to [email protected]
'or submit a form at http://www.ostrosoft.com/contact.asp

Option Explicit

Dim oSMTP 'As OSSMTP.SMTPSession

Set oSMTP = CreateObject("OSSMTP.SMTPSession")

oSMTP.Server = "smtp.mail.yahoo.com" 'SMTP server name or IP address
oSMTP.Port = 25
oSMTP.MailFrom = "[email protected]" 'sender e-mail address
oSMTP.SendTo = "[email protected]" 'recipient e-mail address
oSMTP.AuthenticationType = 2	'0 = AuthNone, 1 = AuthPOP, 2 = AuthLogin, 3 = AuthPlain
oSMTP.Username = "my name" 'name for mailserver authentication
oSMTP.Password= "my password" 'password for mailserver authentication
oSMTP.MessageSubject = "test message" 'message subject or use GetPropertyValue(".MySubject") to retrieve a property from HB
oSMTP.MessageText = "this is a test" 'message text or use GetPropertyValue(".MyText") to retrieve a property from HB
oSMTP.RaiseError = True

oSMTP.SendEmail

Set oSMTP = Nothing
Osler

Posted: Thu Feb 28, 2008 12:20 pm
by James D
That script worked great..... Thank everyone for all your help. We have now overcomed the sending of email, now a new question is; will this script worked for pop (incoming) email. I mean basic email send from a cell-phone. Not the long emails you get from your mother, father, wife, or etc. Basic email that says in the subject "Basement Light On," and trigger HB to proform a task.

Posted: Thu Feb 28, 2008 12:42 pm
by Steve Horn
I'm certainly not the expert on this, or much else. But I don't see why Richard's email check&show process could not be modified to work. Since it captures the subject line when the VBScript executes the SHOW_EMAIL sub, you could develop a standard. HB preamble, like "HB: Turn basement light on" that could be ID'd by the Email VBscript to set a property in the EMAIL "device". But what do I know....