Skip to Content
0
Jul 09, 2014 at 12:53 PM

abap report to send email in background

806 Views

Hello,

This code works perfectly in foreground, but don't work in Background !!

DATA: out TYPE ole2_object,
outmail TYPE ole2_object.


CREATE OBJECT out 'Outlook.Application' .

CALL METHOD OF out 'CREATEITEM' = outmail

EXPORTING #1 = 0.

SET PROPERTY OF outmail 'TO' = 'address@example.com'.

SET PROPERTY OF outmail 'SUBJECT' = 'Sending emails'.

SET PROPERTY OF outmail 'BODY' = 'this is how u do it using OLE'.

CALL METHOD OF outmail 'SEND'.

SET PROPERTY OF out 'Visible' = 1.

FREE OBJECT out.



Any Help...?