Page 1 of 1 1
Topic Options
#48870 - 2000-01-24 06:47 AM OLE-Functions
Anonymous
Unregistered


I try to use OLE-Functions under NT to send Outlook-eMails by a KIX-script. But only OLECREATEOBJECT works (returns a handle to an eMail-object). I cannot use OLEPUTPROPERTY to set recipinet, subject.... The function call always gives me a "Script error: error in paramter(s)"
Any clues?

Top
#48871 - 2000-01-25 06:13 AM Re: OLE-Functions
Anonymous
Unregistered


There's a utility called POSTIE that can be used to automatically send emails from POP servers, so this would work with Exchange and may be easier than using OLE.

Check it out at http://www.infradig.com/postie/

When we tried it with KiXtart we couldn't get it working until we specified the host IP address rather than the host name of the Exchange server.

Matt

Top
#48872 - 2001-01-28 03:15 PM Re: OLE-Functions
Anonymous
Unregistered


How do you get postie worked with Kixtart?
I have tried a whole time but it doesn't work.
I try it to start with:
SHELL "postie.exe -host:192.168.0.1 -to:some@where.com -from:any@body.com -s:bale -nomsg"
It fails with the error: Could not sent error= -1
Domain name required for sender adress.

When I try it with:
SHELL "%comspec% /c postie.exe -host:192.168.0.1 -to:some@where.com -from:any@body.com -s:bale -nomsg"
I get the error File not found.

Please can you put your script here?
Maybe can I see a difference between the scripts.

------------------
http://www.sanderwinkel.com

Top
#48873 - 2001-01-28 07:19 PM Re: OLE-Functions
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
KiX-script using OLE-Functions to send Outlook E-mails.

This script can be used to send mail from NT/2000. (In Win9x OleCallFunc dosn't work)

code:

;Create OLE-handle to Outlook
$MailApp = OleCreateObject("Outlook.Application")

;Create New mail item
$NewMail = Val("&" + OleCallFunc($MailApp, "CreateItem", "s", "0"))

;Get handle for recipients
$Recipients = Val("&" + OleGetProperty($NewMail, "Recipients"))
;Add Recipient(s), make a loop if you want to add more than one recipient
$Mailto = "Recipient@Domain.com"
$Err = OleCallProc($Recipients, "Add", "s", "$MailTo")

;Insert the text(body) in the mail
$Msg = "This is a test"
$Err = OlePutProperty($NewMail, "Body", "s", "Msg")

;Send the mail
$Err = OleCallProc($NewMail, "Send")

;Release all handles obtained by OleCreateobject, OleCallFunc and OleGetProperty
$Err = OleReleaseObject($Recipients)
$Err = OleReleaseObject($NewMail)
$Err = OleReleaseObject($MailApp)

Erik

[This message has been edited by kholm (edited 28 January 2001).]

Top
#48874 - 2001-01-28 08:34 PM Re: OLE-Functions
Anonymous
Unregistered


Erik, thanks for your script, but poorly I have W9x cliënts in my network so this script will not work in my network.
Maybe you have a script for Postie too?

------------------
http://www.sanderwinkel.com

Top
#48875 - 2001-01-31 08:51 AM Re: OLE-Functions
Anonymous
Unregistered


Hey Awinkel,

try to start this script instead:

code:

Shell "postie.exe -host:129.168.0.1 -to:some@@where.com -from:any@@body.com -s:Kix Rocks -nomsg"


Kix normally treats words with a @ in front of it as a macro, but when you use double @ it doesn't.

I can also recommend a program called Blat for sending SMTP trough scripting.

Hope it works.

------------------
Cheers....

David

Top
#48876 - 2001-01-31 10:02 PM Re: OLE-Functions
Anonymous
Unregistered


Thankyou, it works perfectly!

------------------
http://www.sanderwinkel.com

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.118 seconds in which 0.07 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org