How to send attachment(file) in javamail via JSP ?
Dear Friends,
Please guide me for :
(1) my e-mail client is using JSP. So, hoW to send file-attachments via jsp ?
Please specify example for attaching file(s) to a message object in JSP ( and only in JSP ).
I have used HTML <input type="file" .... > control , but don't know how to bring that file to the jsp file and then attach it to the message object.
Thank u.
I wouldn't recommend using JSP to do that. I would use a servlet instead. Then you are just writing Java code, and to answer your two questions you need to learn about JavaMail (1) and get some already-written classes to do file uploads such as this one: http://www.servlets.com/cos/index.html (2).
Similar Messages
-
Send Attachment Files Of MM03 via email
Dear Experts,
I have requirement of send Attachment files of MM03 transaction Via Email.
Example.
Go to TCODE MM03.
Select Views: Basic Data1 and Basic Data 2.
Click on GOS (Generic Object Services) where you find Attachment List.
I want to send that PDF files Via Email.
Please tell me how I can read that file and send via Email as attachment.
Thank youHi
1. Readout the GOS FM: BDS_GOS_CONNECTIONS_GET > make list of Attachments...
2. Read the object: FM: SO_OBJECT_READ
3. Download it into a Temp directory: FM: SO_OBJECT_DOWNLOAD
4. Upload into itab: cl_gui_frontend_services=>gui_upload
5. Put Table with text into Email.. & send... FM: SO_NEW_DOCUMENT_ATT_SEND_API1
6. delete Temp file
that was my way....
Robert -
How to send .CSV file via email in Oracle10g/11g PL/SQL
Hi Guys,
Can any one let me know or suggest me how to send .csv file via email attachment using Oracle PL/SQL.
Thanks in advance!
Regards,
LRKA FAQ. Use UTL_MAIL (if attachment is 32KB less). Else use UTL_SMTP. Search this forum. Search using google.
-
How to send audio files as attachments?There is no attachment option in mail and no share option in MUSIC
i have some voice samples in Music file .how to share those files? or plz tel me where to store the voice samples
-
How to send image file through mail without any attachment
Plz tell me how to send image file through mail without any attachment ( i mean not converting that image into pdf or any format ) i want to send that text or image through mail .
Hi Sandeep,
I think you can setup the type of email in Shared office Settings in transaction S016.
There is an option called <Preset document classes>
You choose this pushbutton to branch to the maintenance screen for the document classes that are directly displayed to users in the Business Workplace for selection when they use the Create function. The name under which the documents are displayed can also be maintained.
http://help.sap.com/saphelp_nw70/helpdata/en/6c/69c30f418d11d1896e0000e8322d00/content.htm
Haven't tried it though.
Regards,
Siddhesh -
How to send a file as an attachment using mailx
Hi
Can any one tel me how to send a file as an attachment using mailx command in shell script.
Thanks,
Suman.Wrong forum where to ask such questions.
Check this one link:
http://www.unix.com/shell-programming-scripting/18370-sending-email-text-attachment-using-mailx.html?t=18370#post70254 -
How to send word file as attachment in an email
Hi All,
I have a scenario where the a word document is sent using a file adapter and mail adapter puts it as an attachment and sends it to designated email group.
Now the issue is the attachment that I am getting is text file, but i want it to be a word format file.
Pls advice..
XierHi,
Just give this a shot.
In the file adapter.
Set Additional File(s) .
and follow this document how to send additional file, rules and naming conventions and parameters.
http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
Itz simple.
<b>Cheers,
*RAJ*</b>
I -
How to send txt file as attachement in email
Hi Experts ,
How to send txt file as attachement in email .
which function module i useHi,
Try to use this one
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
Hope it can solve your problem!
Good luck!
Tao -
C5-03 -how to send music files via bluetooth
hi
i've c5-03 mobile
1.can any one tell me how to send music files via bluetooth
2.there only mark all option ann no mark several option can any one tell me r there any software updates for this
Solved!
Go to Solution.PerLs wrote:
Hi,
You can do it with the file manager this is how i use to do it. You will find it in menu|applications|office folder
There is also a possibility to long press on the track and send. Im not sure if C5-03 support this... But go to you music libery and find the track you want then long press on it and press send.the long press method works
If i have helped at all a click on the white star below would be nice thanks.
Now using the Lumia 1520 -
How to send a file to a web service
I am developing a web service application which needs to accept a CAD model as input. Would any one tell me how to send a file from a client application to service provider.
thanks in advanceYou can use mime encoding inside your SOAP request, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<data>
<file>
<name>filename.zip</name>
<content>FVberI0XlJincJEGmcbVyMOGpdWGl1bYB2r1y2vYicHqq0WYuergigzYB20GvMLZ
Ag9YicHozwLSieOUieDLzgrLCZKncI9dCMvHDg9YicGPdqOVu3vIAMvJDcaOkq0kl0TLExDVCMrZ
DwfSifnVzNr3yxjLkq0kl1rPDgXLicHdB252zxj0zwqGzNjVBsbmyxnLCKPLDcbqq0WPdqOVqxv0
l1jVB3qGmIaWifiGl0LUzM8GmsaWifiGpJ4ncNn0yxj0EhjLzG0kndyYzxiGpdWGl1nPEMuGmJyG
mdaWndiZmYaWmdaWmcbUdqOWmdaWmda0ndi1idaWmdaWig4ncNrYywLSnG0kjsvft0yncG==
</content>
</file>
</data>
</soap:Body>
</soap:Envelope>This can even be accomplished from within Pl/Sql. Otherwise you can use the WS-Attachment feature which is (I think) not yet supported by Oracle.
Regards,
Michiel -
How to send XML file to https server using POST
Hi, I am having an requirement, that I have to connect to https server and I have to pass an input XML file as a response server will give me output XML file.
The certificate validation part is over, I am using FileInputStream to read the XML file and attaching this to connection.getOutputStream(); but server is throwing me DTD does n't match.
Can any body tell me how to send XML file, I have to use any DOM parser to send the XML file, suggest me and give me sample code.
Thanks,Can anybody give me the solution
-
How to send CSV files to external server
Hi All,
How to send CSV files to external server (not to application server).
I know how to download files to application server.
Please give me the steps to send CSV files to external server.
Is it posiible with RFCs? If yes, then plz provide me the steps. Do we need to create RFC destination for this.
Appriciate your help with rewarding points.
Please help as this is an urgent requirementhi,
you can send via xi.
chk this blog
a) content conversion (sender)
/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
b)content conversion (receiver)
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
<b>
reward points if this helps you.</b>
Siva
Message was edited by:
SivaKumar -
Please tell me How to send excel file content to MAILBOX
Hello ,
Can anybody tell me how to send Excel file data to MailboxHi,
Check this sample code.
INITIALIZATION .
CLASS cl_abap_char_utilities DEFINITION LOAD.
gf_etb = cl_abap_char_utilities=>horizontal_tab. "For horrizontal tab
gf_cr = cl_abap_char_utilities=>cr_lf. "For enter
gf_lf = cl_abap_char_utilities=>newline. "For new line
Declaration
DATA: lwa_hd_change TYPE sood1,
lt_objcont TYPE STANDARD TABLE OF soli,
lwa_objcont TYPE soli,
lt_receivers TYPE STANDARD TABLE OF soos1,
lwa_receivers TYPE soos1 ,
lt_att_cont TYPE STANDARD TABLE OF soli,
lwa_att_cont TYPE soli,
lt_packing TYPE STANDARD TABLE OF soxpl,
lwa_packing TYPE soxpl,
lf_sent TYPE sonv-flag,
lf_size TYPE i.
CONSTANTS: lc_obj(11) TYPE c VALUE 'BOMSouthco',
lc_desc(20) TYPE c VALUE 'BOM Download',
lc_lang(1) TYPE c VALUE 'E',
lc_raw(3) TYPE c VALUE 'RAW',
lc_net(1) TYPE c VALUE 'U',
lc_mail(4) TYPE c VALUE 'MAIL',
lc_xls(3) TYPE c VALUE 'XLS',
lc_ext(3) TYPE c VALUE 'EXT'.
Passing values to the strutures used in SO_OBJECT_SEND function module
lwa_hd_change-objla = lc_lang.
lwa_hd_change-objnam = lc_obj.
lwa_hd_change-objdes = lc_desc.
lwa_hd_change-objlen = 255.
lwa_objcont-line = text-t29.
APPEND lwa_objcont TO lt_objcont.
CLEAR lwa_objcont.
lwa_receivers-recextnam = text-t31.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
lwa_receivers-recextnam = text-t30.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
Passing values for the attachment file
LOOP AT gt_output INTO gwa_output.
CONCATENATE gf_lf gwa_output-matnr gf_etb gwa_output-idnrk gf_etb
gwa_output-type gf_etb gwa_output-menge gf_etb
gwa_output-meins gf_etb gwa_output-comp gf_etb
INTO lwa_att_cont-line.
APPEND lwa_att_cont TO lt_att_cont.
CLEAR lwa_att_cont.
ENDLOOP.
CHECK lt_att_cont IS NOT INITIAL.
DESCRIBE TABLE lt_att_cont LINES lf_size.
lwa_packing-transf_bin = ' '.
lwa_packing-head_start = 1.
lwa_packing-head_num = 0.
lwa_packing-body_start = 1.
lwa_packing-body_num = lf_size.
lwa_packing-file_ext = lc_xls.
lwa_packing-objlen = lf_size * 255.
lwa_packing-objtp = lc_ext.
lwa_packing-objdes = lc_desc.
lwa_packing-objnam = lc_obj.
APPEND lwa_packing TO lt_packing.
CLEAR lwa_packing.
CHECK gf_error IS NOT INITIAL. "Check if unix file is written
FM to send email to the intended recipients
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = lwa_hd_change
object_type = lc_raw
IMPORTING
sent_to_all = lf_sent
TABLES
objcont = lt_objcont
receivers = lt_receivers
packing_list = lt_packing
att_cont = lt_att_cont
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
originator_not_exist = 20
x_error = 21
OTHERS = 22.
IF sy-subrc = 0.
MESSAGE s004 WITH text-t34.
ENDIF.
COMMIT WORK.
Reward if helpful.
Regards,
Ramya -
How to send a file from FTP to external server
My requirement is to send a file from FTP to D3(External) server.
Now I am able to store the file in Appln server.
I want to send the file created by the program thru FTP to D3 server.
I know the username,Password,HostID,RFC destination details.
How to send the file from FTP to D3.
If u have any program,Plz send it...
I dont want the function modules name...I want the example code ....
Thanks in advance.Hi Sumi,
You could do it so that you create a .bat or .cmd script to your server which does your ftp transfer.
To do this you must use sm69 to create a external operating system command which you can call from FM SXPG_COMMAND_EXECUTE. To SXPG_COMMAND_EXECUTE you the file you need to transfer as a parameter.
What happens is that your abap program passes the file to windows batch script (.bat .cmd) which will then do the transfer for you.
Here's a sample of ftp-script for windows:
echo open IP_ADDRESS_TO_YOUR_SERVER > c:zftp_transfer.ftp
echo USERNAME>> c:zftp_transfer.ftp
echo PASSWORD>> c:zftp_transfer.ftp
echo put YOUR_FILE>> c:zftp_transfer.ftp
echo quit>> c:zftp_transfer.ftp
ftp -s:c:zftp_transfer.ftp
also take a look here for more details:
http://support.microsoft.com/?kbid=96269
Ok, this might be a bit trivial but if your server is unix/aix etc.. Instead of using batch script you must do a shell script.
Regards,
Ville -
HELP!!! - How to send a file to a server?
How to send a file(as it is) to the server i'm connected to, if i have access to the output-stream?
Ummm read the APIs of anything you don't understand. Documentation is your friend, I hope you are not being lazy. But I'm in a good mood so here:
// Make sure you try to catch any IOExceptions
// Code expanded for clarity;
OutputStream yourOutputStream = getYourOutputStream; // You said you can get the outputstream to the server/socket. I assume you made a connection.
BufferedOutputStream bos = new BufferedOutputStream(
yourOutputStream ); // Always a good idea to use buffers
// Your object is your file
File yourObject = new File("blabla.jpg");
FileInputStream fis = new FileInputStream(yourObject);
byte[] b = new byte[1024]; // A good size read
while( fis.read(b) != -1){// read 1024 bytes into array at a time, returns -1 at end of file
bos.write(); //write to the server
fis.close(); // close the inputstream
yourObject = null; // help the gc
bos.flush(); // flush the buffer, close does this, but it is good form
bos.close(); // close the output to the server--Thunder
PS - The Duketer is in!
Maybe you are looking for
-
MGR-11401 error in ORACLE 7.3.4 servers
Hi All, I want to run a shell script connecting to oracle database and redirect the output to a file. Please find the command i am using and the error received. Kindly suggest me an alternate or correct the same. GMX-/home/oracle/health: svrmgrl @dbh
-
Hello, Is there any way to draw various boxes in smartform without importing graphics or creating a window for each box and selecting frames in Output Options? I have a requirement where the page has tons of boxes of various shapes and sizes adjacent
-
I was fooled by Apple. Worldwide warranty doesn't exist
I had one of the worst disappointments with the service from Apple. My iPhone is presenting a defect and believing that Apple is worried about their consumers and also that my iPhone is within the warranty period, I called Apple Care to solve my prob
-
Entourage Calendar Events gone bye-bye
I have the Blackberry 8130 and downloaded PocketMac for Blackberry to sync. (PocketMac v1.2(1.4)). Two annoyances have come up since my first sync: I use only Entourage calendar and want to shut off the ICal options that keep popping up. My last sync
-
Why not have a section in app store for iOS 4.3 and earlier?
I LOVE "remote" app and airport. Since i have had to restore all my ipods for various reasons, i am now no longer able to download the remote app since apple only supports iOS 5 or later. They have instantly rendered my whole apple setup useless. The