cancel
Showing results for 
Search instead for 
Did you mean: 

Sending HTML mail using code in workflow

Former Member
0 Kudos
68

Hi All

I follow somerecomendation to create a program to send the mail out. using a program

My code looks as the following.



    DATA:   l_docdata TYPE sodocchgi1,
            li_content TYPE TABLE OF solisti1,
            li_receiver TYPE TABLE OF somlreci1,
            l_ename     TYPE pa0002-cname,
            l_text(255),
            lw_receiver TYPE somlreci1.


    l_docdata-obj_name = 'Notification'.
    l_docdata-sensitivty = 'P'.
    l_docdata-proc_syst = sy-sysid.
    l_docdata-proc_clint = sy-mandt.
    l_docdata-obj_descr = 'TEST'.

 l_text  = 'Testing Content'.
APPEND l_text TO li_content. CLEAR l_text.

 lw_receiver-receiver = 'MyMailtest@GM ail.com'.
 lw_receiver-rec_type = 'U'. 
 APPEND lw_receiver TO li_receiver.


    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
      EXPORTING
        document_data              = l_docdata
        commit_work                = 'X'
        DOCUMENT_TYPE              = 'HTM'
      TABLES
        object_content             = li_content
        receivers                  = li_receiver
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        document_type_not_exist    = 3
        operation_no_authorization = 4
        parameter_error            = 5
        x_error                    = 6
        enqueue_error              = 7
        OTHERS                     = 8.


I try to use the code above and i manage to send the mail out. However when i change the l_text = 'Testing Content' to l_text = '<A HREF="http://www.google.com">Click Here</A>' , it does not reach my mailbox even in in transaction SCOT, i can see that it was succesfully transmited.

Anyone have any idea about this?

Thanks.

Regards,

Bryan.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member554978
Active Contributor
0 Kudos

Try passing like this:

DOCUMENT_TYPE = 'URL'

Former Member
0 Kudos

Hey PJ,

I manage to send out the email using the htm type. However, instead of having a hyperlink saying click here and it link to another page, i am getting something like this in the email.



Click Here <http://www.google.com>  

In my code, i write

 <A HREF="http://www.google.com">Click Here</A> 

, but the content just turn to above. What i wan is a CLICK HERE link and will link to google.

Thanks.

Regards,

Bryan.