cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure SCOT/RFC destination to send email to external addresses

Former Member
0 Kudos

Hi,

I have an ABAP program which sends out an email to email addresses such as yourname@company.com, i configured SCOT and entered our company exchange server address in the SMTP node, and it works just fine. Problem is the program also needs to send emails to internet mail id's such as xyz@yahoo.com or xyz@hotmail.com, and here it doesnt work, the email request shows up in SOST as failed saying that the address is unrecognized, we are able to send receive emails from internet id's as well using our email client (outlook), i just have no idea how to get the same to work from my ABAP program, i guess i am missing some BASIS configuration, can anybody help please?

Accepted Solutions (0)

Answers (2)

Answers (2)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Also, If you haven't seen this document yet......

http://help.sap.com/saphelp_nw04/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm

Regards,

Rich Heilman

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please see the following example. Make sure you are setting the recipient type correctly.



report zrich_0003 .

data: maildata type sodocchgi1.
data: mailtxt  type table of solisti1 with header line.
data: mailrec  type table of somlrec90 with header line.

start-of-selection.

  clear:    maildata, mailtxt,  mailrec.
  refresh:  mailtxt, mailrec.

  maildata-obj_name = 'TEST'.
  maildata-obj_descr = 'Test'.
  maildata-obj_langu = sy-langu.

  mailtxt-line = 'This is a test'.
  append mailtxt.

  mailrec-receiver = 'someone@somewhere.com'.
<b>  mailrec-rec_type  = 'U'.</b>
  append mailrec.

  call function 'SO_NEW_DOCUMENT_SEND_API1'
       exporting
            document_data              = maildata
            document_type              = 'RAW'
            put_in_outbox              = 'X'
       tables
            object_header              = mailtxt
            object_content             = mailtxt
            receivers                  = mailrec
       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.
  if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

Regards,

Rich Heilman

Former Member
0 Kudos

yes i am setting the recipient type correctly ('U'), like i said my program works as long as i am sending emails to my company email address which too falls under category 'U'.

athavanraja
Active Contributor
0 Kudos

check out this weblog, may be something is missing when you configured SMTP (this weblog explains configuring SMTP as well)

/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface

Regards

Raja

Former Member
0 Kudos

Hi,

I have already been through this article and have done all the steps, but the error message in SOST says

The message from the node could not be delivered to recipient as the recipient is unknown.

Check the recipient address, correct if necessary and send the message to the correct address.

If the node is an R/3 System, the address is not contained in address management or SAPoffice exception management. In this case, you should maintain the address here.

If the node is not an R/3 System, you must maintain the address in the appropriate system.

i guess since i am using my company microsoft exchange server as the SMTP node, the node is not an R3 system, in this case where do i maintain addresses like xyz@yahoo.com/gmail.com/hotmail.com.

Former Member
0 Kudos

finally after much thought, i ave decided to change the smtp server address in SCOT to our external SMTP server address, ( not in the local network), but now the SOST error message says that mail could not be sent as there is no connection to the node, i guess i have to create a RFC destination to provide this connectivity.

assuming so, i tried to use the following guide to create te RFC destination:-

1. Create your RFC destination for outbound email using transaction SM59

RFC Destination : SAP_INTERNET_GATEWAY

Connection Type : T

Description : SAP internet mail gateway

Click on 'Explicit Host' if you wanton demand gateway dameon invocation.

Program : /sapmnt/SID/exe/mlunxsnd

Target Host : Enter hostname that runs your central instance.

Click 'Test Connection' and you should seea successfull message

however on testing the connection, it says RFC connection could not be opened, can anyone help me out as to how to create a working RFC destination.