Skip to Content
0
Former Member
Jan 29, 2010 at 05:33 AM

Need to send Smart form via email through Driver program

64 Views

Hi All,

We need to send smart form via email through a new driver program (z program). Can you please guide me on this.

I have used the following code to achieve this. We are getting message saying 'Mail request has created' when executed, but the mail is not sent.

lvs_comm_type = 'INT'.
lvs_comm_values-adsmtp-SMTP_ADDR = e_mail.
lvs_comm_values-adsmtp-R3_USER = 'X'.
lvs_comm_values-adsmtp-ENCODE = '0'.

call function 'CONVERT_COMM_TYPE_DATA'
exporting
pi_comm_type = lvs_comm_type
pi_comm_values = lvs_comm_values
pi_screen = ' '
pi_newid = 'X'
importing
pe_itcpo = lvs_itcpo
pe_device = lvf_device
pe_mail_recipient = p_mail_recipient
pe_mail_sender = p_mail_sender
exceptions
comm_type_not_supported = 1
recipient_creation_failed = 2
sender_creation_failed = 3
others = 4.
if sy-subrc ne 0.
raise COMMUNICATION_ERROR.
endif.

control_parameters-device = 'MAIL'.

output_options-TDIMMED = 'X'.
output_options-TDDELETE = 'X'.

CALL FUNCTION fm_name
exporting
CONTROL_PARAMETERS = control_parameters
MAIL_RECIPIENT = mail_recipient
MAIL_SENDER = mail_sender
OUTPUT_OPTIONS = output_options
USER_SETTINGS = space
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.

Thank you