I want to use the following script to generate an automatic mail:

$OutlookMailItem = 0
$recipient = "recipient"
$subject = "subject"
$message = "message"
$outlook= OleCreateObject("outlook.application")
$namespace= Val("&"+OleCallFunc($outlook, "getnamespace", "s", "MAPI"))
$= OleCallFunc($namespace, "logon")
$mailitem= Val("&"+OleCallFunc($outlook, "createitem", "s", "0"))
$recipients= Val("&"+OleGetProperty($mailitem,"recipients"))
$= OleCallFunc($recipients,"add","s","$recipient")
$= OlePutProperty($mailitem, "subject", "s", "$subject")
$= OlePutProperty($mailitem, "body", "s", "$message")
$= OleCallFunc($mailitem, "send")
$= OleCallFunc($namespace, "logoff" )
$= OleReleaseObject($recipients)
$= OleReleaseObject($mailitem)
$= OleReleaseObject($outlook)

Unfortunately, this only works in older versions of kix32. Can anyone help me with this piece of scripting to adjust it? I would like to use it with the newest version 4.11 ! I don't know how this COM automation works!

Thnx in advance