Error occurred while accessing component property method:send. Operation aborted.

deivaa.dhayalan

New Member
Hello,

In our application i am using the below code for sending email for alert purpose.


/* Email Alert*/

DEFINE VAR vOfficeHandle AS COM-HANDLE NO-UNDO.
DEFINE VAR vObjoutlookMsg AS COM-HANDLE NO-UNDO.

CREATE "Outlook.Application" vOfficeHandle.
vObjoutlookMsg = vOfficeHandle:CreateItem(0).

ASSIGN
vObjoutlookMsg:To = 'Your_Name@Your_Domain.com'
vObjoutlookMsg:Subject = 'Test Mail for Outlook'
vObjoutlookMsg:Body = 'Hai BDC, This is Test Mail '.

vObjoutlookMsg:SAVE().
vObjoutlookMsg:Send().


RELEASE OBJECT vOfficeHandle.
RELEASE OBJECT vObjoutlookMsg.

/* Email Alert*/


Whenever I open MS Outlook, the above program is working fine. But When I close Outlook and execute the same program giving an Error.

"Error occurred while accessing component property method send. Operation aborted Error 0x80004004".

Please some one help me to solve this issue,


Thanks in Advance,

Deivanayaga Perumal D.
 

Attachments

  • Error.jpg
    Error.jpg
    28.5 KB · Views: 26
The only solution is to make sure that Outlook is running when you are trying to access via the automation object. OLE Automation is not my strength so please bear with me. Something like this ( courtesy of the not so easy to reach knowledge base )
[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Environment[/TD]
[TD="class: data2Col first last"]OpenEdge 10.xProgress 9.xWindows[/TD]
[/TR]
[/TABLE]

[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Question/Problem Description[/TD]
[TD="class: data2Col first last"][TABLE="class: htmlDetailElementTable"]
[TR]
[TD]How to send email using a Microsoft Outlook Com object?
Can I send email from ABL using Outlook?[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]



[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Error Message[/TD]
[TD="class: data2Col first last"][/TD]
[/TR]
[/TABLE]



[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Defect Number[/TD]
[TD="class: data2Col first last"][/TD]
[/TR]
[/TABLE]



[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Cause[/TD]
[TD="class: data2Col first last"][TABLE="class: htmlDetailElementTable"]
[TR]
[TD][/TD]
[/TR]
[/TABLE]

[/TD]
[/TR]
[/TABLE]



[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Resolution[/TD]
[TD="class: data2Col first last"][TABLE="class: htmlDetailElementTable"]
[TR]
[TD]Sample code to send email using Microsoft Outlook COM object:
DEFINE VARIABLE olApp AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE olNS AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE olMail AS COM-HANDLE NO-UNDO.

CREATE "Outlook.Application" olApp.
olNS = olApp:GetNamespace( "MAPI" ).
olNS:Logon().
olMail = olApp:CreateItem( 0 ). olMail:TO = "myaddress@mycompany.com".
olMail:Subject = "Subject here".
olMail:Body = "Body Here.".

olMail:SEND().

MESSAGE "All Done ..." VIEW-AS ALERT-BOX.

olNS:Logoff().

RELEASE OBJECT olNS.
RELEASE OBJECT olMail.
RELEASE OBJECT olApp.[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]



[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Workaround[/TD]
[TD="class: data2Col first last"][TABLE="class: htmlDetailElementTable"]
[TR]
[TD][/TD]
[/TR]
[/TABLE]

[/TD]
[/TR]
[/TABLE]



[TABLE="class: detailList"]
[TR]
[TD="class: labelCol first last"]Notes[/TD]
[TD="class: data2Col first last"][TABLE="class: htmlDetailElementTable"]
[TR]
[TD]References to Written Documentation:
Microsoft Knowledge Base 220595
http://support.microsoft.com/kb/220595
[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]
should do.

Heavy Regards, RealHeavyDude.
 
Back
Top