1. 变量定义:
类:
send_requesttype ref to cl_bcs.
类:
document typeref to cl_document_bcs.
类:
fail type refto cx_bcs.
接口:
recipient typeref to if_recipient_bcs.
2.?? 编程步骤:
2.1. 创建发送请求:
send_request =cl_bcs=>create_persistent( ).
2.2. 创建整理发送内容
document =cl_document_bcs=>create_document(
i_type?????? = ‘RAW’
i_text?????? = 邮件内容
i_subject = 邮件抬头 ).
document->add_attachment:这个可以添加些附件
2.3. 添加邮件内容到发送请求
send_request->set_document( document).
2.4. 邮件地址转换
recipient =cl_cam_address_bcs=>create_internet_address( 邮件地址)
2.5. 添加邮件地址到发送请求
send_request->add_recipient( recipient)
2.6. 正式发送并且提交作业
send_request->send( i_with_error_screen =‘X’ )
commit workand wait.
3. 具体实例
4. 效果查看: