Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in sending email

Former Member
0 Likes
1,348

Hi experts,

I am getting this exception when i am using the below code to send email.

*" Add recipient (e-mail address)

MOVE cl_cam_address_bcs=>create_internet_address( <fs_recipients>-address )

TO w_recipient.

*" Add recipient with its respective attributes to send request

CALL METHOD w_send_request->add_recipient

EXPORTING

i_recipient = w_recipient

i_express = <fs_recipients>-express

i_copy = <fs_recipients>-copy

i_blind_copy = <fs_recipients>-blind_copy

i_no_forward = <fs_recipients>-no_forward.

*" Set send immediately flag

w_send_request->set_send_immediately( c_x ).

*" Send document

CALL METHOD w_send_request->send( ).

-


Only Email address is passed to the method cl_cam_address_bcs=>create_internet_address , it generates a exception 'CX_ADDRESS_BCS'

Strange , it works for one email id and does not work for the other.

What can be the reason. How to solve it?? Or is any other method there in same class to add recepients.

Hope to get useful answers asap

Best Regards

Bijal

Hi experts,

I am getting this exception when i am using the below code to send email.

*" Add recipient (e-mail address)

MOVE cl_cam_address_bcs=>create_internet_address( <fs_recipients>-address )

TO w_recipient.

*" Add recipient with its respective attributes to send request

CALL METHOD w_send_request->add_recipient

EXPORTING

i_recipient = w_recipient

i_express = <fs_recipients>-express

i_copy = <fs_recipients>-copy

i_blind_copy = <fs_recipients>-blind_copy

i_no_forward = <fs_recipients>-no_forward.

*" Set send immediately flag

w_send_request->set_send_immediately( c_x ).

*" Send document

CALL METHOD w_send_request->send( ).

-


Only Email address is passed to the method cl_cam_address_bcs=>create_internet_address , it generates a exception 'CX_ADDRESS_BCS'

Strange , it works for one email id and does not work for the other.

What can be the reason. How to solve it?? Or is any other method there in same class to add recepients.

Hope to get useful answers asap

Best Regards

Bijal

3 REPLIES 3
Read only

Former Member
0 Likes
1,238

Hi Bijal,

Use this structure to catch the exception below

l_addr_exception TYPE REF TO cx_address_bcs, " Address Exception

TRY.

CATCH cx_address_bcs INTO l_addr_exception.

ENDTRY.

Therefore this way you can catch the exception.

Regards,

Md Ziauddin.

Read only

Former Member
0 Likes
1,238

Hi,

The problem is not to catch exception , but to see why is it getting raised. Since its working for one email id and not for the other.

Thanks

Read only

0 Likes
1,238

The problem is not to catch exception , but to see why is it getting raised.

So why don't you debug it?