Application Development 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: 

Change sender Address when using SAP Mail via Exchange

Former Member
0 Kudos

Hi,

I'm using FM ZSO_DOCUMENT_SEND_API1 to send email with .pdf attachment. all works fine but the recipient sometimes replies to the email which I dont want to happen, so I need the email to appear to have come from an alternative address than mine.e.g. from 'saphelpdeskatxxx.com'

....code I have tried to change is Originator here...

CALL FUNCTION 'SO_OBJECT_SEND'

EXPORTING

  • EXTERN_ADDRESS = ' '

  • FOLDER_ID = ' '

  • FORWARDER = ' '

OBJECT_FL_CHANGE = OBJECT_FL_CHANGE

OBJECT_HD_CHANGE = OBJECT_HD_CHANGE

  • OBJECT_ID = ' '

OBJECT_TYPE = OBJECT_TYPE

OUTBOX_FLAG = PUT_IN_OUTBOX

ORIGINATOR = ORIGINATOR <----


ORIGINATOR_TYPE = ORIGINATOR_TYPE

  • OWNER = ' '

  • STORE_FLAG = ' '

IMPORTING

OBJECT_ID_NEW = OBJECT_ID_NEW

SENT_TO_ALL = SENT_TO_ALL

ORIGINATOR_ID = SENDER_ID

but that doesnt work.

Is this something I need to do with Exchange and not SAP?

Any help appreciated.

Steve

6 REPLIES 6

Former Member
0 Kudos

The SENDER E-mail address comes from the SAP user running the job. To override this, go to SU01 and create a new user such as SENDER. In the FIRST & LAST NAMES code your sender name and in the E-MAIL code the email address. Use SENDER, when calling your RFC.

Former Member
0 Kudos

Have finally found the solution.

SENDER_ADDRESS = 'nobody at dummy.com'.

the bit I was missing was

SENDER_ADDRESS_TYPE = 'SMTP'.

as opposed to it being set as SPACE

0 Kudos

Hi Steve,

I am facing the same problem - can you tell me how I can change the User name using one of the standard SAP FM's ???

Thanks ,

Aditya

0 Kudos

Hi Aditya,

I took a copy of the SOI1 function group, called it ZSOI1. Copied Function SO_NEW_DOCUMENT_ATT_SEND_API1 to Z version. In there there's a call to FM ZSO_DOCUMENT_SEND_API1

In call arguments set SENDER_ADDRESS to desired static email address, then set SENDER_ADDRESS_TYPE = 'SMTP' - it was that statement that I was stuck on for months

Hope that helps,

Steve

0 Kudos

.

0 Kudos

Hi Steve,

Thanks for the info,trying it out.

Regards,

Aditya