cancel
Showing results for 
Search instead for 
Did you mean: 

Changing sender email address while sending email

Former Member
0 Kudos

Can I change the sender address while sending an email to some recipient . I can find the paramater for passing recepient email id , but the sender one is taken from user master . I want to change it to some other address . Is that possible .

Any help wud be appreciated ..

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi there

I am using the Business transaction

SAMPLE_PROCESS_00002040

can i do it here ?

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I think you can do this using BCS. Are you using BCS? If not, then you can do it also this way.




* In order to send a mail from someone
* other than the current user, you must
* use the funciton module SO_OBJECT_SEND
* and give parameters to the ORGINATOR
*
*  ORIGINATOR = me@mycompany.com'.
*  ORIGINATOR_TYPE = 'U'.

report zrich_0003 .


data: maildata type sood1.
data: mailtxt  type table of solisti1 with header line.
data: mailrec  type table of soos1  with header line.


start-of-selection.

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


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


      mailrec-recextnam = 'you@yourcompany.com'.
      mailrec-recesc    = 'E'.
      mailrec-sndpri    = '1'.
      mailrec-sndart    = 'INT'.
      mailrec-mailstatus = 'E'.
      append mailrec.


    maildata-objnam = 'Test'  .
    maildata-objdes = 'Test' .
    maildata-objla  = sy-langu.


    call function 'SO_OBJECT_SEND'
         exporting
              object_hd_change           = maildata
              object_type                = 'RAW'
              outbox_flag                = 'X'
              originator                 = 'donotreply@yourcompany.com'  "Sender
              originator_type            = 'U'
         tables
              objcont                    = mailtxt
              objhead                    = mailtxt
              receivers                  = mailrec
         exceptions
              object_not_sent            = 15
              object_type_not_exist      = 17
              operation_no_authorization = 21
              parameter_error            = 23
              too_much_receivers         = 73
              others                     = 1000.

  endif.

* submit rsconn01 with mode = 'INT' and return.

Regards,

RIch Heilman