Sending email with 1-2 MB attachment
Why sending email with small attachment in iPad IOS7 feels like waiting for a flight delay without announcement ?
Very embarrassing for Apple to missed this issue....
Internet connection is fine, but email could not get through the outbox.... Oh my God...
Hey,
Many people have expirienced this...
The problem for most people were their, internet connection, or their device.
This might not work, for some people.
I would recommend holding down the power button and the home button until the apple logo shows up.
Then you can open mail and send your attachment, hopefully.
If that was successfull, have a good evening!
-- Shamurocks45
Similar Messages
-
Shell Script to send email with .txt file as attachment
Dear Al,
Could any one help me with code, for sending email with .txt file as attachment using shell script.
Thank You!978334 wrote:
Dear Al,
Could any one help me with code, for sending email with .txt file as attachment using shell script.
Thank You!http://bit.ly/XHfSCz
https://forums.oracle.com/forums/search.jspa?threadID=&q=sendmail&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein -
Why is gmail blocking me from sending email with a "pages" document attached?
Why is gmail blocking me from sending email with a "pages" document attached? I've checked the document for viruses with "MacKeeper" and it's clean.
Google reads your emails, in case you did not know that. Unless you are sending an email containing content Google can extract and add to its vast database of personal information, Google has no use for it.
Google Mail is becoming progressively useless. It won't accept .zip attachments, at least not the last time I tried, it will eventually prevent you from using an email client unless you visit their web mail interface, and it will disable your account if you attempt to log in from someplace Google deems is not where Google thinks you ought to be.
Gmail is worth every cent you paid.
Get rid of MacKeeper. It is capable of doing nothing beneficial and will only cause problems. -
Sending emails with both body and attachment to multiple recipients
I have a requirement to send email with body and attachment to multiple recipients.
Body of the email is a standard text. It is a proxy-to-mail scenario.
Here is what I've done: (I'm using PI 7.11)
One mapping from Source to Target structure (format of the attachment text file)
Second mapping from Target Structure to Mail Package format.
In the second mapping I'm concatenating the output of first step into "Content" of the Mail Package.
"XIPAYLOAD" is the message protocol used.
The "Keep attachments" option in the Mail adapter allows only to send "Content" as attachment or as body of the email.
How to send an email with both content and text?
The other problem is even with using ASMA, I can't send email to multiple recipients. I can only do CC and TO for 1 person each - a total of 2. Although I can resolve this by creating mailing lists, it is better if this can be addressed in PI.
Thanks for any input you can provide!
Edited by: crazylad on Jan 18, 2012 3:39 PMThank you for your response Mikael.
For the first question, I was able to find the solution in the following blog:
XI Mail Adapter : Dynamically building attachment and message body content using a simple UDF
(I just needed to search with the right set of key words )
The key is to set the "Content Encoding" as "None" in the mail adapter. If this is not done, the mail will be sent with an attachment - untitled.bin containing both the mail body and the attachment text. Also, don't forget to check the "Keep Attachments" checkbox in the mail adapter.
Multiple recipients could be added by separating the email IDs with a Comma. I have used ASMA to set the recipients. -
To send email with editable PDF/XLS attachment
Hi All,
Is it possible to send editable PDF/XLS attachment in a mail to the customer via SAP, if yes how?
Please Help! Urgenthi,
*Sending mail with attachment
* This program will allowed you to send email with attachment.
* First, specify the attachment file from your local hardisk and execute.
* Next, specify the sender email address and click the send button.
report y_cr17_mail.
data method1 like sy-ucomm.
data g_user like soudnamei1.
data g_user_data like soudatai1.
data g_owner like soud-usrnam.
data g_receipients like soos1 occurs 0 with header line.
data g_document like sood4 .
data g_header like sood2.
data g_folmam like sofm2.
data g_objcnt like soli occurs 0 with header line.
data g_objhead like soli occurs 0 with header line.
data g_objpara like selc occurs 0 with header line.
data g_objparb like soop1 occurs 0 with header line.
data g_attachments like sood5 occurs 0 with header line.
data g_references like soxrl occurs 0 with header line.
data g_authority like sofa-usracc.
data g_ref_document like sood4.
data g_new_parent like soodk.
data: begin of g_files occurs 10 ,
text(4096) type c,
end of g_files.
data : fold_number(12) type c,
fold_yr(2) type c,
fold_type(3) type c.
parameters ws_file(4096) type c default 'c:\debugger.txt'.
* Can me any file fromyour pc ....either xls or word or ppt etc ...
g_user-sapname = sy-uname.
call function 'SO_USER_READ_API1'
exporting
user = g_user
* PREPARE_FOR_FOLDER_ACCESS = ' '
importing
user_data = g_user_data
* EXCEPTIONS
* USER_NOT_EXIST = 1
* PARAMETER_ERROR = 2
* X_ERROR = 3
* OTHERS = 4
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
fold_type = g_user_data-outboxfol+0(3).
fold_yr = g_user_data-outboxfol+3(2).
fold_number = g_user_data-outboxfol+5(12).
clear g_files.
refresh : g_objcnt,
g_objhead,
g_objpara,
g_objparb,
g_receipients,
g_attachments,
g_references,
g_files.
method1 = 'SAVE'.
g_document-foltp = fold_type.
g_document-folyr = fold_yr.
g_document-folno = fold_number.
g_document-objtp = g_user_data-object_typ.
*g_document-OBJYR = '27'.
*g_document-OBJNO = '000000002365'.
*g_document-OBJNAM = 'MESSAGE'.
g_document-objdes = 'sap-img.com testing by program'.
g_document-folrg = 'O'.
*g_document-okcode = 'CHNG'.
g_document-objlen = '0'.
g_document-file_ext = 'TXT'.
g_header-objdes = 'sap-img.com testing by program'.
g_header-file_ext = 'TXT'.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = sy-uname
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
* FOLMEM_DATA =
* RECEIVE_DATA =
* File from the pc to send...
method1 = 'ATTCREATEFROMPC'.
g_files-text = ws_file.
append g_files.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
method1 = 'SEND'.
g_receipients-recnam = 'MK085'.
g_receipients-recesc = 'B'.
g_receipients-sndex = 'X'.
append g_receipients.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header.
*-- End of Program
Hope this helps, Do reward. -
Can't send email with large (over 1MB) attachment
Win 7 64-bit, Thunderbird 31.2.0, eSet antivirus (but disabling it for email doesn't help), godaddy email server (works fine from godaddy web mail), port 80 (been using this port for years; 25 doesn't work)
Sending email with a 974KB attachment works. Email with a 1.4MB (and larger) attachment doesn't work. The error message appears pretty quickly (5 seconds at the most).
The message is "the connection to SMTP server smtpout.secureserver.net timed out".
This problem seem to appear at random, then go away and all is well (for a while).No. The modem is an Arris obtained from Comcast on 6/9/2014 after the prior one failed.
-
Send email with spool in excel attachment
Hi,
I have this function:
CALL FUNCTION 'Z_SEND_EMAIL_SPOOL_PDF'
EXPORTING
application = 'EMAIL'
emailtitle = texttitle
recextnam = email
src_spoolid = tsp01-rqident
TABLES
texttab = body.
And code:
FUNCTION z_send_email_spool_pdf .
*"*"Interfase local
*" IMPORTING
*" REFERENCE(APPLICATION) LIKE SOOD1-OBJNAM DEFAULT 'EMAIL'
*" REFERENCE(EMAILTITLE) LIKE SOOD1-OBJDES
*" VALUE(RECEXTNAM) LIKE SOOS1-RECEXTNAM
*" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
*" TABLES
*" TEXTTAB STRUCTURE SOLI
*- local data declaration
DATA: ohd LIKE sood1,
oid LIKE soodk,
to_all LIKE sonv-flag,
okey LIKE swotobjid-objkey.
DATA: g_document LIKE sood4,
g_header_data LIKE sood2,
g_authority LIKE sofa-usracc,
lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE,
l_folder_id LIKE sofdk,
l_objcont LIKE soli OCCURS 0 WITH HEADER LINE,
i_bin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
l_objhead LIKE soli OCCURS 0 WITH HEADER LINE,
folder_id LIKE soodk,
object_id LIKE soodk,
link_folder_id LIKE soodk,
hd_dat LIKE sood1.
DATA: desired_type LIKE sood-objtp,
real_type LIKE sood-objtp,
attach_type LIKE sood-objtp,
otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
ali LIKE sood-objtp VALUE 'ALI', " ABAP lists
pdf LIKE sood-objtp VALUE 'PDF', "PDF format
pbyte TYPE i,
t_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
objtype LIKE rststype-type,
type LIKE rststype-type.
CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',
c_objtp LIKE g_document-objtp VALUE 'RAW',
c_file_ext LIKE g_document-file_ext VALUE 'PDF'.
DATA: BEGIN OF receivers OCCURS 0.
INCLUDE STRUCTURE soos1.
DATA: END OF receivers.
* Fist part: Verify if the spool really exists
SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
CHECK sy-subrc = 0.
*- fill odh
CLEAR ohd.
ohd-objla = sy-langu.
ohd-objnam = application.
ohd-objdes = emailtitle.
ohd-objpri = 3.
ohd-objsns = 'F'.
ohd-ownnam = sy-uname.
*- send Email
CONDENSE recextnam NO-GAPS.
CHECK recextnam <> space AND recextnam CS '@'.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
authority = 'SP01'
client = tsp01-rqclient
name = tsp01-rqo1name
part = 1
IMPORTING
type = type
objtype = objtype
EXCEPTIONS
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
OTHERS = 5.
attach_type = c_objtp.
desired_type = pdf.
IF objtype(3) = 'OTF'.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = src_spoolid
IMPORTING
pdf_bytecount = pbyte
TABLES
pdf = t_pdf.
ELSE.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = src_spoolid
IMPORTING
pdf_bytecount = pbyte
TABLES
pdf = t_pdf.
ENDIF.
PERFORM convertir_tabla_pdf_2 TABLES t_pdf l_objcont.
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
owner = sy-uname
region = ou_fol
IMPORTING
folder_id = l_folder_id
EXCEPTIONS
OTHERS = 5.
* fill out informations about the header of the email
CLEAR: g_document.
g_document-foltp = l_folder_id-foltp.
g_document-folyr = l_folder_id-folyr.
g_document-folno = l_folder_id-folno.
g_document-objtp = c_objtp.
g_document-objdes = emailtitle.
g_document-file_ext = c_file_ext.
g_header_data-objdes = emailtitle.
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
method = 'SAVE'
office_user = sy-uname
IMPORTING
authority = g_authority
TABLES
objcont = texttab
attachments = lt_attachments
CHANGING
document = g_document
header_data = g_header_data
EXCEPTIONS
OTHERS = 1.
object_id-objtp = c_objtp.
object_id-objyr = g_document-objyr.
object_id-objno = g_document-objno.
folder_id-objtp = l_folder_id-foltp.
folder_id-objyr = l_folder_id-folyr.
folder_id-objno = l_folder_id-folno.
link_folder_id-objtp = l_folder_id-foltp.
link_folder_id-objyr = l_folder_id-folyr.
link_folder_id-objno = l_folder_id-folno.
hd_dat-file_ext = pdf.
hd_dat-objdes = emailtitle.
CALL FUNCTION 'SO_ATTACHMENT_INSERT'
EXPORTING
object_id = object_id
attach_type = attach_type
object_hd_change = hd_dat
owner = sy-uname
TABLES
objcont = l_objcont
objhead = l_objhead
EXCEPTIONS
active_user_not_exist = 35
communication_failure = 71
object_type_not_exist = 17
operation_no_authorization = 21
owner_not_exist = 22
parameter_error = 23
substitute_not_active = 31
substitute_not_defined = 32
system_failure = 72
x_error = 1000.
* FORM SO_OBJECT_SEND_REC *
FORM so_object_send_rec
TABLES objcont STRUCTURE soli
receivers STRUCTURE soos1
USING object_hd STRUCTURE sood1
folder_id
object_id
link_folder_id.
DATA: oid LIKE soodk,
to_all LIKE sonv-flag,
okey LIKE swotobjid-objkey.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
extern_address = 'X'
* object_hd_change = object_hd
* object_type = 'RAW'
outbox_flag = 'X'
sender = sy-uname
owner = sy-uname
folder_id = folder_id
object_id = object_id
store_flag = 'X'
link_folder_id = link_folder_id
IMPORTING
object_id_new = oid
sent_to_all = to_all
office_object_key = okey
TABLES
objcont = 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.
IF sy-subrc <> 0.
RAISE others.
ENDIF.
ENDFORM.
* FORM INIT_REC *
FORM init_rec TABLES receivers STRUCTURE soos1.
CLEAR receivers.
REFRESH receivers.
MOVE sy-datum TO receivers-rcdat .
MOVE sy-uzeit TO receivers-rctim.
MOVE '1' TO receivers-sndpri.
MOVE 'X' TO receivers-sndex.
MOVE 'U-' TO receivers-recnam.
MOVE 'U' TO receivers-recesc.
MOVE 'INT' TO receivers-sndart.
MOVE '5' TO receivers-sortclass.
APPEND receivers.
ENDFORM.
With this function I can send a spool in pdf format by email. But, now I need send a spool in Excel (xls) format by email. I try to disconnect 'CONVERT_OTFSPOOLJOB_2_PDF' and 'CONVERT_ABAPSPOOLJOB_2_PDF' but doesnt work.
Can you help me?
A lot of thanks in advance.
Best regards.Hi.
I do not think it is feasible to create a worthwhile Excel file from a SAP spool file.
I have reports that send output as Excel attachments to email, but the code (including function modules etc) is too much to post here.
You can use OLE to create an Excel file, but this will not generally work when the report is run in the background.
So my approach is to make the report write an Excel XML file (that's just text after all), and send that as an XLS email attachment. When the email receiver double-clicks on the attachment, it fires up Excel and brings in the data. Most users would not realise that it's not a native Excel file.
One nice touch is to have two sheets in the Excel file, one with the main report and the other with the selection criteria.
Of course there is a lot of work getting started with this.
John -
Send email with txt file as attachment
Hi ,
can any one help me in download as txt file using the function module SO_OBJECT_SEND along with email .
a sample code using this function module would be helpfull.
Thanks,
vinay .Hi vinay,
Not only TXT file, u can send any
other file like word,excel,pdf,exe, etc.
1. There is some trick involved
in the binary files.
2. I have made a program (and it works fantastic)
ONLY 6 LINES FOR EMAILING
BELIEVE ME
ITS A FANTASTIC PROGRAM.
IT WILL WORK LIKE OUTLOOK EXPRESS !
3. The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
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
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
amit m. -
Send email with spool as PDF attachment using class CL_BCS
Hi,
I am converting a spool to PDF using the function module CONVERT_OTFSPOOLJOB_2_PDF. The spool contains graphic images etc just like a script output.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = v_rqident
no_dialog = 'X'
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11.
After this I want to attach the pdf as an attachment to an email and send it. For this purpose I am using the code found in the example BCS_EXAMPLE_5.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'My attachment'
i_att_content_hex = binary_content.
How do I convert the script text into binary content, could you please suggest some help.Old code, but I use:
DATA: lt_pdf TYPE soli_tab,
lt_pdfbin TYPE solix_tab.
* Convert the lines
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = 134
line_width_dst = 255
transfer_bin = 'X'
TABLES
content_in = i_pdf
content_out = lt_pdf
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
IF sy-subrc NE 0.
RAISE convert_error.
ENDIF.
lt_pdfbin = lt_pdf.
Also, keep in mid that that OTF convert function has a 99 page limit - if you can potentially reach that limit, you need to handle the background job process and retrieval of the RAW data from the spool. -
ODI send email with latest error file attachment
We have kick-out/error file with the format *err.txt. Whenever error occurs the same gets overwritten by the latest file. We are attaching this error file on the completion of the job. If error file generates, everything is fine. But, on the successful run, I mean when there are no error file generation, it attaches the previous run error file.
Anyone of you help me how to handle this situation. Is there any way to validate the file generation date before attaching the file.
Thanks in advance
Edited by: user12958295 on Oct 30, 2012 7:42 AMHi,
Thanks for the response.
As of now we are following that as a workaround. However our client wants to avoid the manual work of delete/move/renaming the error file.
Is it possible to check the file generated date with sysdate for attaching the error file by odisendmail.
Thanks!
BRM -
Need to send email with excel sheet as attachment: URGENT
Hi all....i have a requirement where i should extract data from SAP. These datas has to be sent to a mail id entered in the selection screen in excel sheet as an attachment.Can you suggest me any function module that meets the requirement...
For kind information...there is only one selection field for entering the mail id.
Thanks in advance
NandaHi all....i have a requirement where i should extract data from SAP. These datas has to be sent to a mail id entered in the selection screen in excel sheet as an attachment.Can you suggest me any function module that meets the requirement...
For kind information...there is only one selection field for entering the mail id.
Thanks in advance
Nanda -
Sending email with multiple attachments
Hi forum,
I am able to send email with a single attachment using maildemo.sql from: http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
But now I am trying to send email with more than 1 attachment and it does not work. My code that calls the above mentioned package is as follows:
<code>
PROCEDURE send (
psender VARCHAR2,
precipients VARCHAR2,
pcc VARCHAR2,
pbcc VARCHAR2,
psubject VARCHAR2,
pmessage VARCHAR2,
pnumattach NUMBER) -- The number of attachments that need to be sent
IS
p_blob BLOB;
p_filename VARCHAR2(200);
p_filetype VARCHAR2(200);
p_currSeq NUMBER;
conn utl_smtp.CONNECTION;
i NUMBER;
j NUMBER;
len NUMBER;
BEGIN
IF pnumattach > 1
THEN
conn := SEND_EMAIL_HELPER.begin_mail(
sender => psender,
recipients => precipients,
subject => psubject,
mime_type => send_email_helper.MULTIPART_MIME_TYPE);
j := 0;
SELECT seq_attach_transact_id.CURRVAL INTO p_currSeq FROM dual; -- seq_attach_transact_id is a primary key that identifies every single attachment in the table
WHILE (j < pnumattach) LOOP
p_currSeq := p_currSeq - j;
SELECT blob_content INTO p_blob FROM wwdoc_document WHERE transaction_id = p_currSeq;
SELECT name INTO p_filename FROM wwdoc_document WHERE transaction_id = p_currSeq;
SELECT mime_type INTO p_filetype FROM wwdoc_document WHERE transaction_id = p_currSeq;
SEND_EMAIL_HELPER.begin_attachment(
conn => conn,
mime_type => p_filetype,
inline => TRUE,
filename => p_filename,
transfer_enc => 'base64');
-- split the Base64 encoded attachment into multiple lines
i := 1;
len := DBMS_LOB.getLength(p_blob);
WHILE (i < len) LOOP
IF(i + SEND_EMAIL_HELPER.MAX_BASE64_LINE_WIDTH < len)THEN
UTL_SMTP.Write_Raw_Data (conn,
UTL_ENCODE.Base64_Encode(
DBMS_LOB.SUBSTR(p_blob, SEND_EMAIL_HELPER.MAX_BASE64_LINE_WIDTH, i)));
ELSE
UTL_SMTP.Write_Raw_Data (conn,
UTL_ENCODE.Base64_Encode(
DBMS_LOB.SUBSTR(p_blob, (len - i)+1, i)));
END IF;
UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
i := i + SEND_EMAIL_HELPER.MAX_BASE64_LINE_WIDTH;
END LOOP;
SEND_EMAIL_HELPER.end_attachment(conn => conn);
END LOOP;
SEND_EMAIL_HELPER.attach_text(
conn => conn,
data => pmessage,
mime_type => 'text/html');
SEND_EMAIL_HELPER.end_mail( conn => conn );
ELSE
utl_mail.send(psender,precipients,pcc,pbcc,psubject,pmessage);
END IF;
END send;
</code>
Can anyone please tell me where am i going wrong.
Message was edited by:
MonkThe easiest is to send an e-mail with multiple attachments to yourself and then view the message in raw to see how it is formatted - how the boundaries work. what the boundary headers are, etc.
Then you use that as a template for your PL/SQL code to generate a MIME body for an e-mail that has multiple attachments.
To debug.. have your PL/SQL code send sample e-mails with multiple attachment to your account, view it in raw format and compare that to the original format you've based your template on.
And none of this is really a PL/SQL issue.. it is all about formatting a valid MIME message for an e-mail. -
Send email with attachments from oracle procedure
This is my procedure
CREATE OR REPLACE PROCEDURE send_parvo_email IS
v_header varchar2(200);
v_file UTL_FILE.FILE_TYPE;
v_count Number;
v_letter Varchar(50);
req UTL_HTTP.REQ;
req1 UTL_HTTP.REQ;
resp UTL_HTTP.RESP;
resp1 UTL_HTTP.RESP;
url VARCHAR2 (2000);
url1 VARCHAR2 (2000);
val varchar2(4000);
val1 varchar2(4000);
p_start_date DATE;
p_end_date DATE;
v_shipment_id varchar2(30);
--v_start_date DATE;
--v_end_date DATE;
Cursor C1 is select shipment_id
from ship_hdr
where trunc(create_time) = trunc(sysdate);
BEGIN
v_letter := 'r_parvo_b19_rpt';
select trunc(sysdate-7),trunc(sysdate-2)
into p_start_date,p_end_date
from dual;
Open C1;
Fetch C1 into v_shipment_id;
Close C1;
save_parvo_email;
UTL_HTTP.SET_PROXY (null,null);
url :=
utl_url.ESCAPE
( 'http://hbc-maroon.heartlandbc.org/reports/rwservlet?userid=test/[email protected]&subject="Parvo Testing Report"&destype=mail&FROM=[email protected]&desname=[email protected]&desformat=PDF&ENVID=QA&report='||v_letter||'&start_date='||p_start_date||'&end_date='||p_end_date);
req := UTL_HTTP.BEGIN_REQUEST (url);
UTL_HTTP.SET_HEADER (req, 'User-Agent', 'Mozilla/4.0 Oracle');
resp := UTL_HTTP.GET_RESPONSE (req);
UTL_HTTP.READ_LINE (resp, val, TRUE);
UTL_HTTP.END_RESPONSE (resp);
Update ship_dtl
set shipment_printed = 'Y'
where shipment_printed is null
and trunc(coll_date) between p_start_date and p_end_date;
commit;
END;
This works fine and sends email with the report as attachment. The attachment is report_name.pdf. I want to change this attachment to be named as shipment_id.pdf. Is this possible and how?
If there is any other method to sent email with attachments . ie run the report and attach the report to the email not as report_name.rdf but shipmenmt_id.rdfThis is my procedure
CREATE OR REPLACE PROCEDURE send_parvo_email IS
v_header varchar2(200);
v_file UTL_FILE.FILE_TYPE;
v_count Number;
v_letter Varchar(50);
req UTL_HTTP.REQ;
req1 UTL_HTTP.REQ;
resp UTL_HTTP.RESP;
resp1 UTL_HTTP.RESP;
url VARCHAR2 (2000);
url1 VARCHAR2 (2000);
val varchar2(4000);
val1 varchar2(4000);
p_start_date DATE;
p_end_date DATE;
v_shipment_id varchar2(30);
--v_start_date DATE;
--v_end_date DATE;
Cursor C1 is select shipment_id
from ship_hdr
where trunc(create_time) = trunc(sysdate);
BEGIN
v_letter := 'r_parvo_b19_rpt';
select trunc(sysdate-7),trunc(sysdate-2)
into p_start_date,p_end_date
from dual;
Open C1;
Fetch C1 into v_shipment_id;
Close C1;
save_parvo_email;
UTL_HTTP.SET_PROXY (null,null);
url :=
utl_url.ESCAPE
( 'http://hbc-maroon.heartlandbc.org/reports/rwservlet?userid=test/[email protected]&subject="Parvo Testing Report"&destype=mail&[email protected]&[email protected]&desformat=PDF&ENVID=QA&report='||v_letter||'&start_date='||p_start_date||'&end_date='||p_end_date);
req := UTL_HTTP.BEGIN_REQUEST (url);
UTL_HTTP.SET_HEADER (req, 'User-Agent', 'Mozilla/4.0 Oracle');
resp := UTL_HTTP.GET_RESPONSE (req);
UTL_HTTP.READ_LINE (resp, val, TRUE);
UTL_HTTP.END_RESPONSE (resp);
Update ship_dtl
set shipment_printed = 'Y'
where shipment_printed is null
and trunc(coll_date) between p_start_date and p_end_date;
commit;
END;
This works fine and sends email with the report as attachment. The attachment is report_name.pdf. I want to change this attachment to be named as shipment_id.pdf. Is this possible and how?
If there is any other method to sent email with attachments . ie run the report and attach the report to the email not as report_name.rdf but shipmenmt_id.rdf -
I have Windows 7, Microsoft Outlook and PSE 13. I have used the "Share photos as embedded images" feature frequently, but today when I went to use it, it wasn't there, only the option to send email with files attached. How do I get back the ability to send emails with photos embedded. I like adding the frames and backgrounds and I think it's easier for recipients to look at the photos. Thanks for any suggestions of things to try.
GailI had a similar problem in that my wife's iphone 5 could not send pics with imessage. Had to set the settings to default to SMS or whatever. After laboring many hours on the web I coincidentally was on the phone with the internet people to question my internet speed. They changed the router channel, which is something that I am capable of doing myself. After that, the pics go over imessage. My own Iphone didn't have the problem. We are both latest IOS 7.0.6.
-
XI Mail Adapter: sending emails with attachment with help of java mapping
Hi ,
On trying out the scenerio mentioned in the blog, using the java mapping provided
"XI Mail Adapter: An approach for sending emails with attachment with help of Java mapping
The scenerio works just fine.
But the payload as the content of the attachment is not getting generated in proper XML format.
I suppose it's because of the replace special characters code part..
Can anyone help me state the modification required in the code.
Thanks!
Regards,
Faria MithaniIt might be a codepage issue. Is your original payload UTF-8?
Maybe you are looking for
-
Hi. My MacBook pro 15" got stolen in lebanon. It run on IOSX and doesn't have Icloud. Is it possible to retrieve the laptop by it's serial number and specification. Any answer is helpful cause it contains many important informations and documents
-
What is the role of Changing Tab infunction module se37
Hi. All, Any body can help me that what is the role of changing tab in function module. i am very confuse to take this. please tell me with code ( code implementation) not only theritical. Regards Mohd Moderator message: please search for information
-
Mysql error 2002 & missing mysql.sock
ok, I know this issue is all over the internet, however after reading many posts I have not been able to solve my issue. I hoping someone can help me out. Lets start with the error I get when typing "mysql start" in the terminal: ERROR 2002 (HY000):
-
I apologize if this has already been addressed in these forums, but the forum search is not currently working (Internal Server Error). I have multiple HTML portlets on my pages. I would like to only show certain HTML portlets to certain user groups.
-
Any recommendations with respect to the best ipad 2 cover
What is the best ipad 2 cover? Looking for maximum protection front and back