Send emails with Outlook Express 6 (windows XP)

Posted by Admin on 11-Oct-2007 05:04

Hi,

Does anyone know how to send an e-mail using Outlook express 6 on Windows XP (not Outlook) through a software written in ABL ?

I'm on OpenEdge 10.1.A.

When i use Outlook express 6 with this code for sending emails :

/*************************************************************************/

DEFINE INPUT PARAMETER mailAddress AS CHARACTER NO-UNDO.

DEFINE INPUT PARAMETER mailCopieCache AS CHARACTER NO-UNDO.

DEFINE VARIABLE Folder AS COM-HANDLE NO-UNDO.

DEFINE VARIABLE MailItem AS COM-HANDLE NO-UNDO.

DEFINE VARIABLE NameSpace AS COM-HANDLE NO-UNDO.

DEFINE VARIABLE Outlook AS COM-HANDLE NO-UNDO.

DEFINE VARIABLE bodyOfMessage AS CHARACTER NO-UNDO.

CREATE "outlook.Application":u outlook connect no-error.

if ERROR-STATUS:error then CREATE "outlook.Application":u outlook.

ASSIGN

NameSpace = Outlook:GetNameSpace("MAPI":U)

Folder = NameSpace:GetDefaultFolder(6).

ASSIGN

MailItem = Folder:Items:Add()

MailItem:To = TRIM(mailAddress)

MailItem:Bcc = TRIM(mailCopieCache)

MailItem:Body = "Test message".

/*-- Envoi de l'e-mail --*/

MailItem:SEND().

/*-- Réallocation de mémoire : suppresion des COM-HANDLE Outlook --*/

IF VALID-HANDLE(MailItem) THEN

RELEASE OBJECT MailItem NO-ERROR.

IF VALID-HANDLE(Folder) THEN

RELEASE OBJECT Folder NO-ERROR.

IF VALID-HANDLE(NameSpace) THEN

RELEASE OBJECT NameSpace NO-ERROR.

IF VALID-HANDLE(Outlook) THEN

RELEASE OBJECT Outlook NO-ERROR.

/******************************************************************/

I have this message :

"Automation server for Outlook.Application is not registered. Set up this server and try again (5893)."

Have you ever seen this kind of message ?

Thanks

Khafid1506

All Replies

Posted by svi on 12-Oct-2007 12:34

If you have not already check out the Knowledgebase; try search by error number:

http://progress.atgnow.com/esprogress/openPromsg.do

Otherwise you may want to open a call with Technical Support.

Posted by Admin on 12-Oct-2007 12:49

It's not a Progress issue - it's an Outlook Express issue. Outlook Express does not support being used as an automation server. CREATE "Outlook.Application" does only work with (the real) Outlook as an automation server.

I suggest sending emails using smtpmail from freeframework.org

Posted by Admin on 17-Oct-2007 08:13

Thanks a lot.

This thread is closed