vbscript to send email/text message to cell phone?

Forum to discuss MLScript plugin that enables VBScript and JavaScript scripting within MLServer3.
ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

vbscript to send email/text message to cell phone?

Postby ricks » Sun May 18, 2008 1:10 pm

I'm trying to get MLServer to send an email or text message to my cell phone when certain events occur. Does anyone know the vbscript to dial out and send an email or text message? I've searched everywhere online but must be asking the wrong question.

Thanks,
Rick

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Postby CinemarDave » Sun May 18, 2008 2:41 pm

You can use the attached script to send an email message via a MLServer command.

Usage is
MLScript|SendMsg~EMail~<<TO>>~<<SUBJECT>>~<<MESSAGE>>

You will have to have Outlook installed on your MLServer PC and also the Redemption.dll to bypass silly Outlook security dialog boxes. You can download redemption from here.
You do not have the required permissions to view the files attached to this post.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Sun May 18, 2008 9:52 pm

Hi Dave,

Thanks for the direction. I'm sure you don't want to get bogged down in this but this crashes MLServer each time I run it.

I installed redemption.dll in the MLServer folder, imported the script and ran:

MLScript|SendMsg~EMail~john.doe@internetprovider.net~Test~This is a test

Unfortunately there is nothing in the log after the command is issued.

Rick

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Postby CinemarDave » Sun May 18, 2008 11:20 pm

The redemption.dll should go into the system32 folder but it should be ok in the MLServer folder. Did you regsvr32 the redemption DLL? The script is working fine on three different servers here. You should also get the script running outside of MLServer. Copy the script to a .vbs file and play with it until it works.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Mon May 19, 2008 10:38 am

Hi Dave,

I used the installer that comes with Redemption. Actually the installer defaults to C:\Program Files\Redemption\. I registered the .dll. I also tried unregistering the .dll and installing and re-registering to Windows\System32. Same result.

The odd thing is that the whole process works - Outlook sends the email so the script must be working, but MLServer crashes (not a hang, gives the MS error message that its closing the MLS program and then disappears).

When MLServer crashes like that is there a usual cause?

Thanks,
Rick

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Postby CinemarDave » Mon May 19, 2008 12:02 pm

MLServer is crashing because one of the objects it created is crashing. Have you tried running the script outside of MLServer via a .vbs file? We need to make absolutely sure that the script is not throwing errors on your system.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Mon May 19, 2008 1:08 pm

Seems to be throwing a syntax error in the following line:

set Application = CreateObject(&#x22;Outlook.Application&#x22;)

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Mon May 19, 2008 1:14 pm

OK, now that I see it written out, the xml quotes &#22 maybe seems to be one problem. I'll swap out the  with " and see what I get.

Rick

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Mon May 19, 2008 2:03 pm

Nope. That was just when I used the script outside of MLScript the  was read incorrectly. Quotes were correct in MLScript.

By commenting out some lines it appears that the first CreateObject (Outlook) is OK but the CreateObject for redemption is failing.

I'm not much help here trying to solve this but my script testing tools are limited.

Rick

User avatar
rondepping
Expert
Expert
Posts: 638
Joined: Sat Jan 08, 2005 9:18 pm
Location: Grand Blanc, Mi
Contact:

Postby rondepping » Mon May 19, 2008 4:50 pm

Its working for me. ( I know that doesn't help you ricks, sorry )

I installed redemption using the installer, and let it pick the directory.

Versions:
MLServer 3.0.509
MLScripts 3.0.6
Redemption.dll 4.5.0.812
MSOutlook 2003 sp3
Windows XP pro sp2

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Mon May 19, 2008 5:20 pm

Hi Ron,

I'm running the same setup except an older version of Outlook. I wonder if that's the issue? I'll see if I can get a newer version installed.

Thanks,
Rick

User avatar
rondepping
Expert
Expert
Posts: 638
Joined: Sat Jan 08, 2005 9:18 pm
Location: Grand Blanc, Mi
Contact:

Postby rondepping » Mon May 19, 2008 5:41 pm

Rick,

From the redemption website:
Outlook Redemption works around limitations imposed by the Outlook Security Patch and Service Pack 2 of MS Office 98/2000 and Office 2002/2003/2007 (which include Security Patch).

So I'm not sure a different version of outlook will make a difference.

In the FAQ it did have this:

6. When I set SafeMailItem.Item property to an Outlook item, my program crashes

The chances are you have Visual Studio .Net beta 2 installed. VS. Net beta 2 replaces some system libraries responsible for providing dynamic type-info support, these files are not used by Outlook (that's why it appears to function normally), Redemption however heavily relies on this functionality. To fix the problem either uninstall VS.Net or upgrade to a later version.



only thing I see about crashing the app.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Mon May 19, 2008 7:38 pm

Ron,

Thanks again for all the help. I upgraded my Outlook 2000 from the original to SP3 and my Visual Basic (only visual tool installed) to the latest with no change.

I can't help thinking its related to the Visual Studio version thing but just can't seem to pin it down yet. Everything works perfectly except for MLServer crashing.

Hey, the night's still young. :)

Thanks,
Rick

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Postby ricks » Tue Apr 21, 2009 3:35 pm

OK, a year later and still can't get it to work. :D

DaveP, if not a problem, can you look at this script and let me know if something is amiss?

Option Explicit
Sub EMail (Params)
dim Application
dim NameSpace
set Application = CreateObject("Outlook.Application")
set Namespace = Application.GetNamespace("MAPI")
Namespace.Logon
dim SafeItem, oItem
set SafeItem = CreateObject("Redemption.SafeMailItem")
set oItem = Application.CreateItem(0)
SafeItem.Item = oItem
SafeItem.Recipients.Add Params(0)
SafeItem.Recipients.ResolveAll
SafeItem.Subject = Params(1)
SafeItem.Body = Params(2)
SafeItem.Send

set oItem = nothing
set SafeItem = nothing
set Namespace = nothing
set Application = nothing
End Sub

Also, if I run this outside of MLS as emai.vbs there's no MLS crash, but also no way to verify it works without having a way to add email adresses, subject, etc.

Thoughts?

Thanks,
Rick


Return to “MLScript”

Who is online

Users browsing this forum: No registered users and 1 guest