Skip to Content
author's profile photo Former Member
Former Member

Send mail from ABAP

Hi all,

do you know if i can send email from ABAP, i specify that i don't have WAS. I understand that i must install SAPConnect and SMTP plug-in but in my case will that function ?

Regards,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 12, 2005 at 01:40 PM

    Even if you don't have WAS, you don't have to install SAPConnect as it's part of the SAP BC layer.

    However it dependes on your platform, you might have to install other components. Eg for Windows/Exchange Server you have to install SXC (SAP Exchange Connector) in the Exchange server.

    Check OSS for details.

    Peter

    Ps: If it helped, please use the reward points functionality:-)

    Add a comment
    10|10000 characters needed characters exceeded

    • It is a shame that your Basis group is being less than helpful. I doubt as a developer that you will have access to make these changes on your own. You will have to make profile parameter changes and then restart the ICM. If you need the steps (perhaps to share them with your Basis Group), have a look at OSS note 455140. It is a very good guide to this setup. It should really only take about 15 minutes to do the setup. Good luck.

  • Posted on Jan 14, 2005 at 10:41 AM

    Hi

    See following routine it will send you data as attachment.

    FORM send_mail.

    it_doc_chng-obj_name = text-016.

    it_doc_chng-obj_descr = text-016.

    DESCRIBE TABLE it_objtxt LINES g_lines.

    READ TABLE it_objtxt INDEX g_lines.

    it_objpack-doc_size = ( g_lines - 1 ) * 255 + STRLEN( it_objtxt ).

    it_objpack-doc_type = 'RAW'.

    APPEND it_objpack.

    it_objpack-head_start = 1.

    it_objpack-head_num = 0.

    it_objpack-body_start = 1.

    it_objpack-transf_bin = 'X'.

    it_objpack-body_num = g_lines.

    it_objpack-doc_type = 'RAW'.

    it_objpack-obj_name = 'ATTACHMENT'.

    it_objpack-obj_descr = g_file.

    APPEND it_objpack.

    • completing the recipient list

    SORT it_vmail.

    DELETE ADJACENT DUPLICATES FROM it_vmail.

    IF l_client NE 'P'.

    it_reclist-receiver = p_email.

    it_reclist-express = 'X'.

    it_reclist-rec_type = 'U'.

    APPEND it_reclist.

    ELSE.

    LOOP AT it_vmail.

    it_reclist-receiver = it_vmail-smtp_addr.

    it_reclist-express = 'X'.

    it_reclist-rec_type = 'U'.

    APPEND it_reclist.

    ENDLOOP.

    ENDIF.

    it_rec_mail[] = it_reclist[].

    IF NOT p_copy IS INITIAL.

    it_reclist-receiver = p_copy.

    it_reclist-express = 'X'.

    it_reclist-copy = 'X'.

    it_reclist-rec_type = 'U'.

    APPEND it_reclist.

    ENDIF.

    CLEAR it_download[].

    it_download[] = it_objtxt[].

    **********Sending the mail with attachment*****************

    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_MAPI'

    EXPORTING

    document_data = it_doc_chng

    put_in_outbox = 'X'

    commit_work = 'X'

    TABLES

    packing_list = it_objpack

    contents_bin = it_objtxt

    contents_txt = it_objtxt

    receivers = it_reclist

    EXCEPTIONS

    too_many_receivers = 1

    document_not_sent = 2

    operation_no_authorization = 4

    OTHERS = 99.

    CASE sy-subrc.

    WHEN 0.

    IF p_update = 'X'.

    PERFORM reference_update.

    ENDIF.

    • PERFORM down_load.

    WRITE:/01 text-019.

    SKIP.

    LOOP AT it_rec_mail.

    FORMAT COLOR 5 INTENSIFIED OFF.

    WRITE:/01 text-010,20 it_rec_mail-receiver.

    ENDLOOP.

    ULINE.

    WHEN 1.

    WRITE: / text-012.

    WHEN 2.

    WRITE: / text-013.

    WHEN 4.

    WRITE: / text-014.

    WHEN OTHERS.

    WRITE: / text-015.

    ENDCASE.

    REFRESH:it_objpack,

    it_objtxt,

    it_reclist,

    it_rec_mail.

    CLEAR:it_objpack,

    it_objtxt,

    it_reclist,

    g_lines,

    it_rec_mail.

    ENDFORM. " send_mail

    Regards

    Suresh Babu Karanam

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 09:21 PM

    check SMICM DISPLAY Service. I believe that you do not see an ICM service with protocal to be SMTP.

    You need to add the parameters like following

    rdisp/start_icman = true

    icm/server_port_0 = PROT=HTTP,PORT=1080

    icm/server_port_1 = PROT=HTTPS,PORT=1443

    icm/server_port_2 = PROT=SMTP,PORT=25000,TIMEOUT=180

    icm/server_port_3 = PROT=SMTP,PORT=25001,TIMEOUT=180

    is/SMTP/virt_host_0 = *:25000;

    is/SMTP/virt_host_1 = *:25001;

    and restart ICM (or the whole SAP). You should see SMTP service on SMICM transaction.

    Try to send email now. It should work

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.