Я ошибся, HTML всё таки пашет, но ...
Следующий код шлёт вроде нормально HTML письма в SAP Ofice (отображается там ссылка), а вот во внешнюю почту падает почему то [censored] какая то. Подозреваю, дело в каких то неправильных конвертациях при посылке наружу...
Кто что может сказать?
Вот что приходит в Lotus:
http://s004.radikal.ru/i208/1004/68/26302fa5bab6.jpgВот что отложилось при посылке этого письма в SapOffice:
http://s45.radikal.ru/i110/1004/5e/e4fc70111c86.jpgCode:
FUNCTION Z_TEST_EMAIL.
*"----------------------------------------------------------------------
*"*"Локальный интерфейс:
*" IMPORTING
*" REFERENCE(P_EMAIL1) TYPE TEXT255 OPTIONAL
*"----------------------------------------------------------------------
* Fill the document data.
data: psubject(40) type c value 'Hello',
p_email(40) type c value 'ASosnov@Technoserv.ru' .
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
if p_email1 ne ''.
p_email = p_email1.
endif.
gd_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
"Append 'MIME-Version: 1.0' to it_message.
"Append 'Content-Type: text/html; charset=ISO-8859-1' to it_message.
"Append '<HTML>' to it_message.
Append '<HEAD>' to it_message.
Append '<TITLE>Как создать свой первый сайт</TITLE>' to it_message.
Append '</HEAD>' to it_message.
Append '<BODY leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>' to it_message.
Append '<CENTER><TABLE width=95% cellpadding=4 cellspacing=0 border=0 class=main>' to it_message.
Append '<TR>' to it_message.
Append '<TD>' to it_message.
Append '<li><a href="/no/ru/brand/"><font color="red"><b>Наш бренд</b></font></a></li>' to it_message.
"Append 'HELLO, WORLD!' to it_message.
"Append '</FONT>' to it_message.
Append '</TD>' to it_message.
Append '</TR>' to it_message.
Append '</TABLE>' to it_message.
Append '</BODY>' to it_message.
"Append '</html>' to it_message.
* Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
"it_packing_list-doc_type = 'HTM'.
it_packing_list-doc_type = 'HTM'.
append it_packing_list.
* Add the recipients email address
clear it_receivers.
refresh it_receivers.
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
append it_receivers.
* Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
COMMIT_WORK = 'X'
IMPORTING
sent_to_all = gd_sent_all
TABLES
packing_list = it_packing_list
contents_txt = it_message
receivers = it_receivers
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.
* Store function module return code
gd_error = sy-subrc.
* Get it_receivers return code
loop at it_receivers.
endloop.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
ENDFUNCTION.