How to Open Outlook Mail from ABAP
We know that there is option to send mail directly from ABAP, but it uses SAP account to send email. In many cases we may not have access or configuration to send email from SAP directly. In certain scenario it might be necessary to send email with outlook, but we want SAP to populate some text/information in advance.
We will be using OLE objects for the same.
DATA: lr_outlook TYPE ole2_object,
lr_mi TYPE ole2_object,
lv_body TYPE string,
lv_sig TYPE string.
CREATE OBJECT lr_outlook 'Outlook.Application'.
CALL METHOD OF
lr_outlook
'CreateItem' = lr_mi
EXPORTING
#1 = 0.
SET PROPERTY OF lr_mi 'To' = 'firstname.lastname@domain.com'.
IF p_emailcc <> space.
SET PROPERTY OF lr_mi 'CC' = 'mr.cc@domain.com'.
ENDIF.
SET PROPERTY OF lr_mi 'Subject' = 'Test Subject Line'.
CALL METHOD OF
lr_mi
'Display'.
SET PROPERTY OF lr_mi 'Body' = 'This is body of the mail'.
FREE OBJECT lr_outlook.
We will be using OLE objects for the same.
DATA: lr_outlook TYPE ole2_object,
lr_mi TYPE ole2_object,
lv_body TYPE string,
lv_sig TYPE string.
CREATE OBJECT lr_outlook 'Outlook.Application'.
CALL METHOD OF
lr_outlook
'CreateItem' = lr_mi
EXPORTING
#1 = 0.
SET PROPERTY OF lr_mi 'To' = 'firstname.lastname@domain.com'.
IF p_emailcc <> space.
SET PROPERTY OF lr_mi 'CC' = 'mr.cc@domain.com'.
ENDIF.
SET PROPERTY OF lr_mi 'Subject' = 'Test Subject Line'.
CALL METHOD OF
lr_mi
'Display'.
SET PROPERTY OF lr_mi 'Body' = 'This is body of the mail'.
FREE OBJECT lr_outlook.
I am thank full to you for sharing the information, its really very helping
ReplyDeleteFrom TEAM Subway Street Run
Thanks
This is helpful customer support review of Outlook, it gives us reliable information about Outlook, thank you so much for sharing this blog. For any kind of technical support for Outlook visit the website Outlook Help Number UK or call at 0800-090-3220.
ReplyDeleteOutlook Account Recovery
ReplyDeleteHow to Change AOL Password
HP Latop not connecting to wifi windows 10
AOL Mail not Syncing
Yahoo mail not Syncing
How to set property with multiple lines of body?
ReplyDeleteThanks for this, I have one question, Is it possible to change from mail id means static for all time..??. Can you please let me know
ReplyDelete