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: 

Emailing

Former Member
0 Kudos

hii

i am using FM <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> for sending mails thru my ABAP Pgm, it works fine but it picks From Name automatically whichever is the login name is

like if i logon with asuppal then the mails comes from <b>asuppal@xxxx.com</b>. can i update the From E-mail id

abhishek suppal

13 REPLIES 13

Former Member
0 Kudos

Abhishek,

In SU3, update ur profile especially EMAIL ID.

Placing the correct email id in the profile will do!!

SAP picks this Email Id as the sender id in the mail.

Thanks

Kam

Note: Allot points if the problem is solved.

0 Kudos

actually my many mails are schedule from one login and dift. programmes are made for that, then i want to set different E-mail ids for different mails how can i do that, if i set in SU03 then the mails will go from same id but i want different mails will go from different id's so that if the receiver receives the mail he can reply back to the correct id.

i hope u guys undertsand the req.

abhishek suppal

Message was edited by: Abhishek Suppal

0 Kudos

Hi Abhishek,

As far as the program is run by the same user, the from address would be the same(the email given in SU03) only.

I did not understand, why should the from address email ID should be changing for different programs?

Regards,

Ravi

0 Kudos

Dear Ravi

as some mails have to be sent from customer id and some mails have to be sent from vendor id, yes but the pgms are all different.....

abhishek suppal

0 Kudos

Hi Abhishek,

I've checked in the FM SO_NEW_DOCUMENT_ATT_SEND_API1, how it is going about setting the from address. It, in turn calls a FM SO_OBJECT_SEND.

It has an importing parameter for sender. It is taking sy-uname as the default.

One work around is to create your own FM instead of

SO_NEW_DOCUMENT_ATT_SEND_API1 with a 'sender' parameter as well and pass that sender to SO_OBJECT_SEND inside your own FM.

Regards,

Ravi

Former Member
0 Kudos

hi,

Use this FM <b> SO_USER_READ_API1 </b>

For further helps, check this link.

http://www.sap-img.com/abap/sending-email-with-attachment.htm

Regards,

Sailaja.

Dont forget to reward points, if answer is helpful.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Did you tried specifying explicitly for the parameters receiver as follows:

i_reclist-receiver = 'xyz@yahoo.com'.

i_reclist-express = 'X'.

i_reclist-rec_type = 'U'. "Internet address

APPEND i_reclist.

...

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

...

TABLES

...

receivers = i_reclist.

Kindly reward points by clicking the star on the left of reply,if it helps.

Former Member
0 Kudos

any clues ???

0 Kudos

Hi Abhishek,

With SO_NEW_DOCUMENT_ATT_SEND_API1 you cannot set the sender email id to adifferent one than that of the SY-UNAME i.e. user running the program. Try SO_OBJECT_SEND instead as this has the desired capability . In fact SO_NEW_DOCUMENT_ATT_SEND_API1 uses SO_OBJECT_SEND to send mail .

Cheers.

Sanjay

0 Kudos

Dear Sanjay,

can we do one thing that before sending the Email the

SY-UNAME 's Email id be Changed by using BAPI BAPI_USER_CHANGE and then after sending the Email again resetting the same to the SY-UNAME, i haven't checked this thing but it just strikes my mind, can it be correct to do so .....

0 Kudos

It can be done but not a good way to do as the user will have to be changed a number of times. Also there may be lock issues on user if your programs sending mails run in succession.

Cheers.

Sanjay

Former Member
0 Kudos

Hi Abhishek,

Its not possible to change the 'From email id' when sending mails using FM SO_NEW_DOCUMENT_ATT_SEND_API1. This FM uses email address which is tied to the user that is executing the program.

But pls check out the FM SO_OBJECT_SEND. I think it can help you.

Regards,

Anjali

Former Member
0 Kudos

Hope this may help you.

CALL FUNCTION 'SO_OBJECT_SEND'

EXPORTING

FOLDER_ID = X_FOLDER_ID

FORWARDER = X_FORWARDER

OBJECT_FL_CHANGE = X_OBJECT_FL_CHANGE

OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE

  • OBJECT_ID = X_OBJECT_ID

OBJECT_TYPE = X_OBJECT_TYPE

OUTBOX_FLAG = ' '

OWNER = X_OWNER

STORE_FLAG = X_STORE_FLAG

IMPORTING

OBJECT_ID_NEW = OBJECT_ID_NEW

SENT_TO_ALL = SENT_TO_ALL

OFFICE_OBJECT_KEY = OFFICE_OBJECT_KEY

TABLES

OBJCONT = OBJCONT

  • ATT_CONT = OBJCONT

RECEIVERS = RECEIVERS

EXCEPTIONS

ACTIVE_USER_NOT_EXIST = 1

COMMUNICATION_FAILURE = 2

COMPONENT_NOT_AVAILABLE = 3

FOLDER_NOT_EXIST = 4

FOLDER_NO_AUTHORIZATION = 5

FORWARDER_NOT_EXIST = 6

NOTE_NOT_EXIST = 7

OBJECT_NOT_EXIST = 8

OBJECT_NOT_SENT = 9

OBJECT_NO_AUTHORIZATION = 10

OBJECT_TYPE_NOT_EXIST = 11

OPERATION_NO_AUTHORIZATION = 12

OWNER_NOT_EXIST = 13

PARAMETER_ERROR = 14

SUBSTITUTE_NOT_ACTIVE = 15

SUBSTITUTE_NOT_DEFINED = 16

SYSTEM_FAILURE = 17

TOO_MUCH_RECEIVERS = 18

USER_NOT_EXIST = 19

X_ERROR = 20

OTHERS = 21.

Pls put the forwarder name in the parameter forwarder.