Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Send external mails API

Former Member
0 Likes
570

Hi.

I'am using the function module SO_NEW_DOCUMENT_SEND_API1 to send external mails.

I need to know if it's possible to specify the default sender. I want to put something like no-reply@name.com.

I didn't found nothing in the function parameters. Or maybe there is another function module that i can use ?

Thanks for your help.

Regards.

Helder

Here's my code :


*Send mail
  CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = doc_data
      put_in_outbox              = 'X'
*      commit_work                = 'X'
    IMPORTING
      new_object_id              = object_id
    TABLES
      object_content             = objcont
      receivers                  = 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.

Code Formatted by: Alvaro Tejada Galindo on Jan 11, 2008 3:05 PM

4 REPLIES 4
Read only

Former Member
0 Likes
548

Hi,

use this FM

HR_FBN_GENERATE_SEND_EMAIL

Read only

athavanraja
Active Contributor
0 Likes
548

Sorry its not a direct answer to your question. but if you are on WAS6.10 or above you can use cl_bcs class to send mail which offers much more flexibility. for sample code you can check out the demo programs

BCS_EXAMPLE_1

BCS_EXAMPLE_2

BCS_EXAMPLE_3

BCS_EXAMPLE_4

BCS_EXAMPLE_5

BCS_EXAMPLE_6

Read only

Former Member
0 Likes
548

Hi,

you can use the class cl_document_bcs to send external mails.

This class has the method set_sender

Kevin Raskin posted an example coding in this forum:

[;

Kindly regards,

Stefan

Read only

Former Member
0 Likes
548

Problem solved.

I used instead the FM SO_DOCUMENT_SEND_API1 wich allows to define the sender. I have missed this one when i was looking for another fm.

Thanks for your help anyway