Send E-mail To Recipients From Recordset Attachment problem
Hello !
I got a recordset which stored a list of recipients emails.
CREATE TABLE IF NOT EXISTS `tasks` (
`id_task` mediumint(9) NOT NULL auto_increment,
`id_procedure` mediumint(9) NOT NULL,
`id_step` mediumint(9) NOT NULL,
`lib_task` varchar(40) NOT NULL,
`recipient_email` varchar(80) default NULL, <---------------- email to use
`email_text` mediumtext,
`url_document` varchar(100) default NULL, <------------------ name of document to send for THIS recipient as attachement
PRIMARY KEY (`id_task`),
KEY `id_procedure` (`id_procedure`),
KEY `id_step` (`id_step`)
There's less than 10 records to process.
Table content :
RECIPIENT 1 DOCUMENT 1
RECIPIENT 2 DOCUMENT 2
RECIPIENT 3 DOCUMENT 3
RECIPIENT 4 DOCUMENT 4
RECIPIENT 5 DOCUMENT 5
RECIPIENT 6 DOCUMENT 6
I want to use the "Send E-mail to Recipients From Recordset" behaviour and Dynamic Datas.
The problem is that each recipients are well processed but all of them receive the attach document of the FIRST one !
Email results :
RECIPIENT 1 DOCUMENT 1
RECIPIENT 2 DOCUMENT 1
RECIPIENT 3 DOCUMENT 1
RECIPIENT 4 DOCUMENT 1
RECIPIENT 5 DOCUMENT 1
RECIPIENT 6 DOCUMENT 1
How can I fix it ?
Thanks for your help. Jérôme.
I try another way to do it, using a html link
> function Trigger_EmailRecordset_E6(&$tNG) {
$rsemailObj = new tNG_EmailRecordset($tNG);
$rsemailObj->setRecordset("rsTasks");
$rsemailObj->setFrom("{KT_defaultSender}");
$rsemailObj->setTo("email_to");
$rsemailObj->setSubject("{rsTasks.lib_task}");
//WriteContent method
$rsemailObj->setContent("{rsTasks.email_text}\n</br>\n</br>\n{rsTasks.url_document}</br>< /br>
<a href=\"http://xxx.xxx.xxx.xxx/yyyyyyyy/{rsTasks.url_document}\">Clic here</a>");
$rsemailObj->setEncoding("UTF-8");
$rsemailObj->setFormat("HTML/Text");
$rsemailObj->setImportance("High");
return $rsemailObj->Execute();
I wonder if I could use Dynamic Data _INSIDE_ {rsTasks.email_text} field ?
Thanks. JM.
Similar Messages
-
Using Dynamic Data in "Send E-Mail To Recipients From Recordset"
Hi,
How can I use Dynamic Data embedded in recordset field ?I try another way to do it, using a html link
> function Trigger_EmailRecordset_E6(&$tNG) {
$rsemailObj = new tNG_EmailRecordset($tNG);
$rsemailObj->setRecordset("rsTasks");
$rsemailObj->setFrom("{KT_defaultSender}");
$rsemailObj->setTo("email_to");
$rsemailObj->setSubject("{rsTasks.lib_task}");
//WriteContent method
$rsemailObj->setContent("{rsTasks.email_text}\n</br>\n</br>\n{rsTasks.url_document}</br>< /br>
<a href=\"http://xxx.xxx.xxx.xxx/yyyyyyyy/{rsTasks.url_document}\">Clic here</a>");
$rsemailObj->setEncoding("UTF-8");
$rsemailObj->setFormat("HTML/Text");
$rsemailObj->setImportance("High");
return $rsemailObj->Execute();
I wonder if I could use Dynamic Data _INSIDE_ {rsTasks.email_text} field ?
Thanks. JM. -
Problem with send email to recipients From recordset behavior
Hello
I use the ^send email to recipients From recordset^ behavior, then words of the subject of sent email stick and the spaces between words in subject removed.
E-Mail charset is utf-8 and language is Persian
for example:
موضوع ايميل من
will be change to:
موضوعايميلمن
notice: spaces are removed
To overcome this problem, please help me
sorry, i'm not good in english
ThanksPersian language is very similar to arabic language
Please help me, I can't solve this problem -
Email recipients from recordset
Hi all,
I'm having real trouble with this and would appreciate some guidance. I have created a form which emails an attached file and has a few fields to fill in such as name / telephone number etc...
At the moment, you have to enter the email address where the form is being sent into the email field. I have a recordset with 15 contacts in it, each with a different email address. I would like to use this recordset to create 15 checkboxes in the form, so that instead of having a blank email field, the user selects one or multiple recipients from the checkboxes - and the form is sent to those people.
Does anyone have any idea how I would do this?
Please help!
NathanHi Nathan,
I've done a similar thing but using groups instead of individuals.
What I did was add a recordset to the send email form that was controlled via a drop down menu breaking the email list into groups.
Before inserting data to the email form you are asked to select a group. The group/recordset is then refreshed with the new query (just the group you selected). Then you can fill in the contents of the form and send the email.
So in your case I think it would be a similar idea. You could either make it in one page or two. First page create the form with the checkboxes to select the email recipients (also it builds the new query for the next page) then pushes that query to the second page to the email form. Fill in the form and send. -
How to send a mail to the user with attachement
Hi Experts,
I have a requirement where user needs to get the automatic mail which has the updated information sheet as the attachement.
Kindly give me a clue on this.
if any body has model program for this...kidnly send it to [email protected]
Thanks in Advance,
AiswaryaHI
good
go throug this link
http://help.sap.com/saphelp_nw04s/helpdata/en/38/71f865c2c9a94ab1dce95792187c16/content.htm
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
go through this report=>
: Report ZSAPTALK :
: Author SAPdev.co.uk :
: Description : :
: Send mail message to SAP mail inbox. :
: Please visit www.sapdev.co.uk for further info :
REPORT ZSAPMAIL NO STANDARD PAGE HEADING.
TABLES: DRAD,
QINF,
DRAW,
SOUC,
SOFD,
DRAP.
DATA: P_RETURN_CODE LIKE SY-SUBRC.
data: d_username LIKE DRAP-PRNAM.
mail declarations
DATA : BEGIN OF NEW_OBJECT_ID. " the newly created email object
INCLUDE STRUCTURE SOODK.
DATA : END OF NEW_OBJECT_ID.
DATA : BEGIN OF FOLDER_ID. " the folder id of the outbox
INCLUDE STRUCTURE SOODK.
DATA : END OF FOLDER_ID.
DATA : BEGIN OF REC_TAB OCCURS 5. " the table which will contain the
INCLUDE STRUCTURE SOOS1. " information on the destination
DATA : END OF REC_TAB.
DATA : BEGIN OF OBJECT_HD_CHANGE. " the table which contains the
INCLUDE STRUCTURE SOOD1. " info for the object we will be
DATA : END OF OBJECT_HD_CHANGE. " creating
DATA : OBJECT_TYPE LIKE SOOD-OBJTP. " the type of object
DATA : BEGIN OF OBJHEAD OCCURS 5. " the header of the object
INCLUDE STRUCTURE SOLI.
DATA : END OF OBJHEAD.
DATA : BEGIN OF OBJCONT OCCURS 0. " the contents of the object
INCLUDE STRUCTURE SOLI. " i.e. the text etc
DATA : END OF OBJCONT.
DATA : BEGIN OF OBJPARA OCCURS 5. " formatting options
INCLUDE STRUCTURE SELC.
DATA : END OF OBJPARA.
DATA : BEGIN OF OBJPARB OCCURS 5. " formatting options
INCLUDE STRUCTURE SOOP1.
DATA : END OF OBJPARB.
DATA : BEGIN OF T_MAIL_TEXT OCCURS 0, "Message table for messages to
STRING(255), "user via mailbox
END OF T_MAIL_TEXT.
Parameter: p_uname like sy-uname.
**START-OF-SELECTION
START-OF-SELECTION.
d_username = p_uname.
PERFORM POPULATE_EMAIL_TEXT.
PERFORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
PERFORM CREATE_AND_SEND_MAIL_OBJECT.
FORM POPULATE_EMAIL_TEXT *
Inserts text for email message *
FORM POPULATE_EMAIL_TEXT.
CLEAR T_MAIL_TEXT-STRING. "puts a blank line in
APPEND T_MAIL_TEXT.
APPEND T_MAIL_TEXT.
adds failed list on to end of success list.
T_MAIL_TEXT-STRING = 'Test email message line 1'.
APPEND T_MAIL_TEXT.
T_MAIL_TEXT-STRING = 'Test email message line 1'.
APPEND T_MAIL_TEXT.
CLEAR T_MAIL_TEXT-STRING. "puts a blank line in
APPEND T_MAIL_TEXT.
T_MAIL_TEXT-STRING = 'Header1 Header2 Header3'.
APPEND T_MAIL_TEXT.
T_MAIL_TEXT-STRING = '----
APPEND T_MAIL_TEXT.
ENDFORM.
*& Form SETUP_TRX_&_RTX_MAILBOXES
Ensure that the mailboxes of the sender (INTMGR) are set up OK
FORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
get the user no of the sender in order to add the mail to the
user name's outbox for future reference
SELECT SINGLE * FROM SOUC
WHERE SAPNAM = SY-UNAME. "SAP name of a SAPoffice user
IF SY-SUBRC NE 0.
"Error finding the SAPoffice user info for the user
MESSAGE E064(ZR53) WITH SY-UNAME.
P_RETURN_CODE = 1.
EXIT.
ENDIF.
*Get the outbox No for the sender from the user No where the folder
" type is an outbox
SELECT * FROM SOFD WHERE OWNTP = SOUC-USRTP "Owner type from ID
AND OWNYR = SOUC-USRYR "Owner year from the ID
AND OWNNO = SOUC-USRNO "Owner number from the I
AND FOLRG = 'O'."Output box
ENDSELECT.
IF SY-SUBRC NE 0.
" Error getting folder information for the user
MESSAGE E065(ZR53) WITH SY-UNAME.
P_RETURN_CODE = 1.
EXIT.
ENDIF.
ENDFORM. " SETUP_TRX_&_RTX_MAILBOXES
*& Form CREATE_AND_SEND_MAIL_OBJECT
FORM CREATE_AND_SEND_MAIL_OBJECT.
FOLDER_ID-OBJTP = SOFD-FOLTP. " the folder type ( usually FOL )
FOLDER_ID-OBJYR = SOFD-FOLYR. " the folder year ( usually 22 )
FOLDER_ID-OBJNO = SOFD-FOLNO. " the folder no.
OBJECT_TYPE = 'RAW'. " the type of object being added
build up the object information for creating the object
OBJECT_HD_CHANGE-OBJLA = SY-LANGU. " the language of the email
OBJECT_HD_CHANGE-OBJNAM = 'PS to DM Interface'. " the object name
mail subject 'Mass Linking of QA, pass/fail'
MOVE TEXT-002 TO OBJECT_HD_CHANGE-OBJDES.
OBJECT_HD_CHANGE-DLDAT = SY-DATUM. " the date of the email
OBJECT_HD_CHANGE-DLTIM = SY-UZEIT. " the time of the email
OBJECT_HD_CHANGE-OBJPRI = '1'. " the priority ( highest )
OBJECT_HD_CHANGE-OBJSNS = 'F'. " the object sensitivity
F is functional, C - company sensitive
object_hd_change-skips = ' '. " Skip first screen
object_hd_change-acnam = 'SM35'. " Batch imput transaction
object_hd_change-vmtyp = 'T'. " Transaction type
add the text lines into the contents of the email
CLEAR OBJCONT.
REFRESH OBJCONT.
free objcont. " added this to delete the mail contents records
LOOP AT T_MAIL_TEXT.
OBJCONT-LINE = T_MAIL_TEXT-STRING.
APPEND OBJCONT.
ENDLOOP.
CLEAR OBJCONT.
build up the table of receivers for the email
REC_TAB-RCDAT = SY-DATUM. " the date to send the email
REC_TAB-RCTIM = SY-UZEIT. " the time to send the email
the SAP username of the person who will receive the email
REC_TAB-RECNAM = D_USERNAME.
the user type of the person who will send the email ( USR )
REC_TAB-SNDTP = SOUC-USRTP.
the user year of the person who will send the email ( 22 )
REC_TAB-SNDYR = SOUC-USRYR.
the user number of the person who will send the email
REC_TAB-SNDNO = SOUC-USRNO.
the sap username of the person who will send the email
REC_TAB-SNDNAM = SY-UNAME.
get the user info for the receiver of the document
SELECT SINGLE * FROM SOUC WHERE SAPNAM = D_USERNAME.
IF SY-SUBRC NE 0.
WRITE : / TEXT-001, D_USERNAME. "usnam.
EXIT.
ENDIF.
the user number of the person who will receive the email ( USR )
REC_TAB-RECNO = SOUC-USRNO.
the user type of the person who will receive the email ( USR )
REC_TAB-RECTP = SOUC-USRTP.
the user year of the person who will receive the email ( USR )
REC_TAB-RECYR = SOUC-USRYR.
the priority of the email ( highest )
REC_TAB-SNDPRI = '1'.
check for delivery on the email
REC_TAB-DELIVER = 'X'.
send express so recipient knows there is a problem
REC_TAB-SNDEX = 'X'.
check for a return receipt
REC_TAB-READ = 'X'.
the sap username of the person receiving the email
REC_TAB-ADR_NAME = D_USERNAME. "usnam.
add this receiver to the internal table
APPEND REC_TAB.
CLEAR REC_TAB.
call the function to create the object in the outbox of the sender
CALL FUNCTION 'SO_OBJECT_INSERT'
EXPORTING
FOLDER_ID = FOLDER_ID
OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
OBJECT_TYPE = OBJECT_TYPE
OWNER = SY-UNAME
IMPORTING
OBJECT_ID = NEW_OBJECT_ID
TABLES
OBJCONT = OBJCONT
OBJHEAD = OBJHEAD
OBJPARA = OBJPARA
OBJPARB = OBJPARB
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
DL_NAME_EXIST = 4
FOLDER_NOT_EXIST = 5
FOLDER_NO_AUTHORIZATION = 6
OBJECT_TYPE_NOT_EXIST = 7
OPERATION_NO_AUTHORIZATION = 8
OWNER_NOT_EXIST = 9
PARAMETER_ERROR = 10
SUBSTITUTE_NOT_ACTIVE = 11
SUBSTITUTE_NOT_DEFINED = 12
SYSTEM_FAILURE = 13
X_ERROR = 14
OTHERS = 15.
IF SY-SUBRC NE 0.
MESSAGE A063(ZR53) WITH SY-SUBRC.
EXIT.
ENDIF.
call the function to send the already created email to the receivers
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
FOLDER_ID = FOLDER_ID
OBJECT_ID = NEW_OBJECT_ID
OUTBOX_FLAG = 'X'
OWNER = SY-UNAME
TABLES
RECEIVERS = REC_TAB
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.
IF SY-SUBRC EQ 0.
MESSAGE I035(ZR53) WITH NEW_OBJECT_ID D_USERNAME. "usnam.
ELSE.
MESSAGE I036(ZR53) WITH D_USERNAME." sy-subrc.
ENDIF.
ENDFORM. " CREATE_AND_SEND_MAIL_OBJECT
thanks
mrutyun -
Send e-mail in HTML-format with attachment
Does function SO_OBJECT_SEND allow to send e-mail with attachment?
Does function SO_DOCUMENT_SEND_API1 allow to send e-mail in HTML format?Hi SS
See if you can understand this sample program
PARAMETERS: po_email TYPE AD_SMTPADR LOWER CASE.
DATA: li_objcont TYPE STANDARD TABLE OF solisti1,
li_reclist TYPE STANDARD TABLE OF somlreci1,
li_objpack TYPE STANDARD TABLE OF sopcklsti1,
li_objhead TYPE STANDARD TABLE OF solisti1,
li_content TYPE STANDARD TABLE OF solisti1,
lwa_objcont TYPE solisti1,
lwa_reclist TYPE somlreci1,
lwa_objpack TYPE sopcklsti1,
lwa_objhead TYPE solisti1,
lwa_content TYPE solisti1,
lwa_doc TYPE sodocchgi1,
l_lines TYPE i.
REFRESH: li_objcont[], li_reclist[],
li_objpack[], li_objhead[],
li_content[].
CLEAR: lwa_objcont, lwa_reclist,
lwa_objpack, lwa_objhead,
lwa_content, lwa_doc.
MOVE '<body>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE '<p>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE 'This is a sample HTML content from test program' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE '</p>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE '</body>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
lwa_reclist-receiver = po_email.
lwa_reclist-rec_type = 'U'.
APPEND lwa_reclist TO li_reclist.
lwa_objhead = 'test.htm'.
APPEND lwa_objhead TO li_objhead.
lwa_content = 'Please find attached document for more details'.
APPEND lwa_content TO li_content.
CLEAR l_lines.
DESCRIBE TABLE li_content LINES l_lines.
READ TABLE li_content INTO lwa_content INDEX l_lines.
lwa_doc-doc_size = ( l_lines - 1 ) * 255 + STRLEN( lwa_content ).
lwa_doc-obj_langu = 'E'.
lwa_doc-obj_name = 'Test HTML file'.
lwa_doc-obj_descr = 'Test HTML file'.
CLEAR lwa_objpack-transf_bin.
lwa_objpack-head_start = 1.
lwa_objpack-head_num = 0.
lwa_objpack-body_start = 1.
lwa_objpack-body_num = l_lines.
lwa_objpack-doc_type = 'RAW'.
APPEND lwa_objpack TO li_objpack.
CLEAR: lwa_objpack, l_lines.
DESCRIBE TABLE li_objcont LINES l_lines.
READ TABLE li_objcont INTO lwa_objcont INDEX l_lines.
lwa_objpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( lwa_objcont ).
lwa_objpack-transf_bin = 'X'.
lwa_objpack-head_start = 1.
lwa_objpack-head_num = 0.
lwa_objpack-body_start = 1.
lwa_objpack-body_num = l_lines.
lwa_objpack-doc_type = 'HTM' .
lwa_objpack-obj_name = 'Test HTML file'.
lwa_objpack-obj_descr = 'Test HTML file'.
APPEND lwa_objpack TO li_objpack.
*Sending the mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lwa_doc
put_in_outbox = 'X'
TABLES
packing_list = li_objpack
object_header = li_objhead
contents_bin = li_objcont
contents_txt = li_content
receivers = li_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc NE 0.
WRITE:/ 'Document sending failed'.
ELSE.
WRITE:/ 'Document successfully sent'.
COMMIT WORK.
ENDIF.
This should give you all you need to know to send an HTML file.
Thanks buddy -
HI folks,
i have to send a mail to outlook for correpanding mailler id with out opeing outlook from my app(iphonoe flex 4.5.1 app.) with taking the input values what ever we have given as input those values has to be send to outlook while pressing submit button on that view....(i dont want to open outlook and user action on that).
Please help out on thsi issue..
Regards,
Madhu.Hello Madhu,
The only way to send an email without opening a client is: using server-side mail objects invoked by your app.
This would be the workflow:
- your user fills in form data (subject, body, mail_to)
- your application sends form data to a server (via httpservice or webservice or AMF)
- the server takes care of sending the mail in a way that is transparent to your user
So: it is not possible to send emails without opening the iPhone client (I think by "outlook" you mean the "mail client" with an Exchange account) for security reasons. You wouldn't want any app to send mails without you pressing "Send" in a known interface. -
To send a mail along with a csv attachment.
Hi All,
my requirement is to send a mail along with a csv file attached to it. Could someone provide me their valuable comments that will guide me. I am using the function module.
SO_NEW_DOCUMENT_ATT_SEND_API1.https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=6015600
https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=3640641
https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=6879100
https://forums.sdn.sap.com/click.jspa?searchID=22504268&messageID=5281059 -
[SOLVED] msmtp: Gmail sends empty mails, Yahoo ignores "from"
I have recently embarked on the atrocious adventure of migrating from Thunderbird to mutt.
So far however, msmtp has consistently refused to properly send mail. Using
echo "Yet another test" | msmtp -a <account> <test>@gmail.com
with this config
defaults
auth on
tls on
tls_starttls on
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
# first gmail address
account gmail
host smtp.gmail.com
port 587
from <mail1>@gmail.com
user <mail1>@gmail.com
password <pass1>
# second gmail address
account gmail2 : gmail
from <mail2>@gmail.com
user <mail2>@gmail.com
password <pass2>
# yahoo
account yahoo
tls_starttls off
host smtp.mail.yahoo.de
from <mail3>@yahoo.de
user <mail3>
password <pass3>
# default
account default : gmail
yields:
1. An empty mail if one of the Gmail accounts is used, including the proper "from" address.
2. A mail with the test sentence if Yahoo is used, but having "youknow@smtp<three digits>.mail.ukl.yahoo.com" as "from".
Any help, please? This is getting really tiresome.
edit: Solution below
Last edited by misc (2010-07-05 16:01:38)If brisbin33's page comes back up, I highly recommend it. It has a ton of great information, and I configured mine based on that. My msmtprc file contains:
# gmail
account gmail
host smtp.gmail.com
port 587
protocol smtp
auth on
from [email protected]
user [email protected]
password EMAILPASS
tls on
tls_nocertcheck
account default : gmail
So my suggestion is to try these tls* lines, and add the protocol lines. Other than that, I don't know much about it. brisbin33 uses these forums, so he may be able to help you directly
Last edited by jac (2010-07-06 13:32:26) -
Send External mail with Attchment from SAP
Hi All,
OUR REQUIREMENT: We need to send EXTERNAL MAIL with ATTACHMENT(Excel) form SAP .
We have developed a function module which converts the internal table data into Excel Format and sends it as an attachment to External Mail.
ISSUE : But our issue is we are unable to open that document using GOOGLE DOCS Could any one help me how to do this.
it was thriughing error like
Error log is .
''Sorry, we are unable to generate a view of the document at this time. Please try again later.
You can also try to download the original document by clicking here. Alternatively, you can view the plain HTML (automatically redirecting).
Regards
Venkat .
Edited by: venkata pradeep on Mar 5, 2012 10:26 AM
Edited by: venkata pradeep on Mar 5, 2012 10:28 AMIs the excel file recognized by MS Excel? If not, then issue is you have wrongly converted your attachment and/or your FM to create an excel file was wrongly coded or you have passed it wrongly to your mail code.
If you consider an OOP approach in sending external mail, refer to this link:
http://wiki.sdn.sap.com/wiki/display/Snippets/SendingmailwithattachmentusingObjectOriented+Approach -
Send e-mail Billing document as PDF Attachment while saving from VF01/02
Hi all,
I have written the code for sending email with PDF attachment. Presently this code is included in the Print program for the smartform and an email is sent when an output is issued manually from VF02/03 where as the requirement is to send email whenever the document is saved.
We need to trigger this while saving the Output type say, <b>VF01</b> GOTO -> HEADER -> OUTPUT (select the output type) -> SAVE - should send an email with PDF attachment.
need ur help on this.
thanks,
Subba.Hello,
Just like you have defined an ouput type for smartforms ,you can define new output type with external email option as medium which will first generate a PDF from invoice data & then send it as email .
I am not sure but you can also try this ::::::
If you have custom-developed smartforms program,then you can add email code at the end of smartform execution by generating PDF, in the same output type instead of creating new.
Thanks. -
Send a mail with a body and attachment
Hi guys!!!!
I have a RFC -> XI -> Mail Scenario!
I'm able to send text in the body of the mail. I'm able to send text as an attachment. But I'd like to send both (text in the body and other text as an attachment). How can I do this?
thanks in advance
JulioFirst, I'd like to thank all the replies! And Jagesh, I solved my problem reading the thread you told me.
I created a message as follow:
<?xml version="1.0" encoding="UTF-8"?>
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>test</Subject>
<From>test_source @ abc.com</From>
<To>test_target @ abc.com</To>
<Content_Type>multipart/mixed; boundary="AaBb--984dfgeSSd3532"</Content_Type>
<Content>*AaBb984dfgeSSd3532*
Content-Type: text/plain
Hello, this is sample data.
*AaBb984dfgeSSd3532*
Content-Type: text/plain;name="CSV_data.csv"
abc
</Content>
</ns:Mail>
In addittion to this, I configured Mail channel as follow:
Content encondig = none
Keep Attachments = false -
Send e-mail with a file as attachment - Break line problems
Hi
I use the function SO_NEW_DOCUMENT_ATT_SEND_API1 to send an e-mail from ABAP program.
With SAP4.5B, all work good, but since we have 4.6C, the attached file is malformatted.
An automatic CRLF break line is generated all 1022 char!
The eattachment is create from content of internal table with a line of 255 char.
How can I avoid the automatic CRLF char or how can I to send a good file ?
ThankHi,
look here:
Re: How to email an attachment with more than 255 characters?
Andreas -
How to send php email using email from recordset?
Hi
I know the headers to use for php mail(), and I use it for
the contact form for my viewers in order to contact the directory
listing's email address ( of which I have hidden by using the words
'Email Us' and use the id to carry through to the form).
I have sucessfully used the $to = [email protected] but when I
want to use the $row_?['email'] it will not send.
Any suggestions? I use a recordset to retrieve the id of the
listing to the contact form.
I will want to follow the same procedure for my jobseekers to
contact employers job adverts.
Thanks
TheresaHi,
There are many sms gateways that have their own api to send sms. You can use them for sms. (They will charge you for the sms!!!)
Moderator edit: Link removed
Thanks
Edited by: PhHein on 20.10.2010 16:11 -
Sending E-Mail with ABAP List as Attachment with custom Extension
Hello everyone.
I have the following problem:
I want to send a ABAP list as an attachment to an external e-mail address with a <b>custom file extension</b>.
Everything works fine, exept the thing with the file extension.
I am using FB 'SO_NEW_DOCUMENT_ATT_SEND_API1'.
When I choose 'ALI' as Packing_List-Doc_Type everything works fine, but the attached file has the extension 'txt'.
When I choose e.g. 'lbl' as Doc_Type, the extension is correct, but the file contains invalid data.
Packinglist code:
<i>AttType = 'ALI'.
Describe Table ObjBin Lines TabLines.
Read Table ObjBin Index TabLines.
ObjPack-Doc_Size = ( TabLines - 1 ) * 255 + strlen( ObjBin ).
ObjPack-Transf_Bin = 'X'.
ObjPack-Head_Start = 1.
ObjPack-Head_Num = 1. "0.
ObjPack-Body_Start = 1.
ObjPack-Body_Num = TabLines.
ObjPack-Doc_Type = AttType.
ObjPack-Obj_Name = 'ATTACHMENT'.
ObjPack-Obj_Descr = cFileName.
Append ObjPack.</i>
function call:
<i>Call Function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
Document_Data = DocData
Put_in_Outbox = 'X'
TABLES
Packing_List = ObjPack
Object_Header = ObjHeader
Contents_Bin = ObjBin
Contents_Txt = ObjTxt
Receivers = RecList
EXCEPTIONS
Too_Many_Recievers = 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.</i>
Thanks for your help,
ArndtHi,
look here:
Re: How to email an attachment with more than 255 characters?
Andreas
Maybe you are looking for
-
Backed up files are Zero K!
I just tried to do a test restore and went back and see that alot of my apps show a generic icon with a white circle and slash and are zero K. So am I screwed? Do I need to start over? I should have backups going back to May.
-
hello guyz.howz the day? well i have a serious problem with my N73, when i record any video my flash comes on. and i tried every thing to turn it off but nothing happened. and it surely consuming my battery life too. plzzz can any one let me know how
-
Hi, I am trying to install EP6 SP3 which i have downloaded from SDN itself. I have successfully installed WAS 6.40 JAVA Stack for MS SQL. Also i have patched oit to SP5. When i try to install the EP6 SP3 it gives an error in the first step ie INSTALL
-
I aacidentally erased a gmail folder from my iPad, how can I geit it back?
I accidentally erased a complete gmail folder from my iPad2, it is possible to recuperate it?
-
HT1222 help with set up new software for iphone 5
After reading the terms and conditions of icloud with new OS update, me iphone 5 will not continue set up although i pressed agree