Need to send attachments in the email

Hi,
I'm trying to write lines in a file. Not all of my lines are not written into the file.
So I'm writing line by line into the file whcih its failed at say 350lines. after that its no more writing the data.
Please anybody let me know how i can write my data into a file (say 2GB) and send the same as an attachment in the mail.
Thanks in Advance.
[email protected]
Here is the sample code which i'm using
Declare
Cursor C1 is
Select * from my_table;
line1     Varchar2(32767);
heading1     Varchar2(32767);
end_of_line     Varchar2(32767);
fileHandler     UTL_FILE.FILE_TYPE;
file_name     VarChar2(100);
po_err_msg varchar2(1000);
Begin
--Open a file in my logical dir 'TEST_UTIL_DIR' for Write
     Select lpad(my_File_Seq.nextval,10,'0')||'.html' into file_name from dual;
     fileHandler     := UTL_FILE.FOPEN('TEST_UTIL_DIR', file_name, 'W');
     line1     := '<table border="1">';
--Writing first line
     Utl_File.Put_Line(fileHandler,line1,False);
     heading1 := '<tr><td><b>'||'Emp No'||'</b></td><td><b>'||'Employee Name'||'</b></td><td><b>'||'Age'||
'</b></td><td><b>'||'Gender'||'</b></td><td><b>'||'Relation'||'</b></td></tr>';
--writing second line
     Utl_File.Put_Line(fileHandler,heading1 ,False);
     For i in C1
     Loop
          Begin
               heading2      := '<tr><td>'||rpad(i.Emp_no,6,' ')||'</td><td>'||rpad(i.Emp_name,30,' ')||'</td><td>'||
               rpad(i.Age,5,' ')||'</td><td>'||rpad(i.Gender,3,' ')||'</td><td>'||rpad(i.Relation,8,' ')||'</td></tr>';
--in the loop
--for each record
--writing each record in the file
          Utl_File.Put_Line(fileHandler,heading2,False);
     Exception
          When Others Then
          Print(sqlerrm);
          End;
     End Loop;
     end_of_line     := '</table>';
     Utl_File.Put_Line(fileHandler,end_of_line,False);
     utl_file.fflush(fileHandler);
     UTL_FILE.FCLOSE(fileHandler);
--sending the file as an attachment.
demo_mail.send_email(
     P_DIRECTORY     =>'TEST_UTIL_DIR',
     P_SENDER     => 'From_user@my_Company.com',
     P_RECIPIENT     => 'to_user@my_Company.com',
     P_CC          => 'cc_user@my_Company.com',
     P_BCC          => 'bcc_user@my_Company.com',
     P_SUBJECT     => 'Testing in Development',
     P_BODY          => 'Please find the following attachments.',
     P_ATTACHMENT1     => file_name,
     P_ATTACHMENT2     => null,
     P_ATTACHMENT3     => null,
     P_ATTACHMENT4     => null,
     P_ERROR          => po_err_msg);
Exception
When others then
Print(sqlerrm);
End;
/

Numerous threads regarding this issue:
http://forums.oracle.com/forums/search.jspa?threadID=&q=attachments+in+the+email&objID=f75&dateRange=lastyear&userID=&numResults=15
Greetings...
Sim

Similar Messages

  • TS3276 I need to send a photo via email as an attachment and not it shown in the body of the email?

    I need to send a photo via email as an attachment and NOT have it shown in the body of the email?  Please help.

    To make attachments not appear in the body of the e-mail as a default, try using the Applications/Utilities/Terminal command below. I suggest copy and paste.
    defaults write com.apple.mail DisableInlineAttachmentViewing -bool YES

  • When i need to send somthing to an email address from a website, the Outlook Express pop up even i do not set it as default's email

    When i need to send somthing to an email address from a website, the Outlook Express pop up even i do not set it as default's email

    http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox

  • Need to send my back up email a reset security questions email but the option does not show when I click on password and security

    Need to send my back up email a reset security questions email but the option does not show when I click on password and security

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (97456)

  • Need to send Smart form via email through Driver program

    Hi All,
    We need to send smart form via email through a new driver program (z program). Can you please guide me on this.
    I have used the following code to achieve this. We are getting message saying 'Mail request has created' when executed, but the mail is not sent.
    lvs_comm_type = 'INT'.
    lvs_comm_values-adsmtp-SMTP_ADDR = e_mail.
    lvs_comm_values-adsmtp-R3_USER = 'X'.
    lvs_comm_values-adsmtp-ENCODE = '0'.
    call function 'CONVERT_COMM_TYPE_DATA'
    exporting
    pi_comm_type = lvs_comm_type
    pi_comm_values = lvs_comm_values
    pi_screen = ' '
    pi_newid = 'X'
    importing
    pe_itcpo = lvs_itcpo
    pe_device = lvf_device
    pe_mail_recipient = p_mail_recipient
    pe_mail_sender = p_mail_sender
    exceptions
    comm_type_not_supported = 1
    recipient_creation_failed = 2
    sender_creation_failed = 3
    others = 4.
    if sy-subrc ne 0.
    raise COMMUNICATION_ERROR.
    endif.
    control_parameters-device = 'MAIL'.
    output_options-TDIMMED = 'X'.
    output_options-TDDELETE = 'X'.
    CALL FUNCTION fm_name
    exporting
    CONTROL_PARAMETERS = control_parameters
    MAIL_RECIPIENT = mail_recipient
    MAIL_SENDER = mail_sender
    OUTPUT_OPTIONS = output_options
    USER_SETTINGS = space
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    Thank you

    Hi,
    For sending smartform output into mail you first have to generate spool request and convert it into PDF and then
    only it can be sended into mail, please find the sample code in the mail below:
    http://wiki.sdn.sap.com/wiki/display/sandbox/ConversionofSpoolRequestDataintoPDFandExcelFormatandSenditintoMail
    Mansi
    Edited by: Matt on Jan 29, 2010 8:25 AM - removed code, instead point to wiki that Mansi authored.

  • I am new to the ethernet communicat​ion using labview. I do not have any hardware. I have two laptop i need to send and recieve the data via these 2 laptop using labview. Kindly help me on this.

    i am new to the ethernet communication using labview. I do not have any hardware. I have two laptop i need to send and recieve the data via these 2 laptop using labview. Kindly help me on this.
    Solved!
    Go to Solution.

    Hi thanks for the help.
    Actually i am trying to send 10 sine signals from server pc to client pc. So i will bundle 10 signals in server pc and send it and in client pc i am unbundling it and need to save in TDMS format.
    Till unbundling i was able to do. TDMS format it is saving only last value. I need to save all the values. Kindly help me on same. I am attaching both the VI.
    Attachments:
    Client.vi ‏62 KB
    Server.vi ‏252 KB

  • HT5312 what do i need to do to change the email address for when i try to reset my password for my account?

    what do i need to do to change the email address for when i try to reset my password for my account?

    Welcome to the Apple Community.
    Start here, change your country if necessary and go to manage your account.

  • Can not see attachments on the Email

    The overview screen shows that there is an attachment but when you select the message the attachment does not show up, this is happening when messages are forwarded. At times when there is a pdf attachment (not a forwarded message) what opens up is the media player. Some pdf attachments have no problems of opening.
    The N900 needs to become a serious phone, this needs to be fixed.
    This does not happen on my N97 !
    Any solutions ?

    This just happened to me. After a bit of messing about I decided to forward the message  back to my own e-mail address.
    Again the email attachment was shown in the overview screen but not in the main email, however, the attachment was now available from the sent items folder.
    Not a fix or solution, more of a bodge!!!
    Hope it helps

  • Many times when I click on 'attach a file' nothing happens. Obviously one needs to send attachments so it is extremely annoying.

    I can send attachments generally but sometimes when I click on attach a file, nothing happens. I am then unable to send the file.

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Did this fix your problems? Please report back to us!
    Thank you.

  • Do not want to display mail attachments in the email body

    When I want to add word processing attachments, usually with .doc extension, the whole of the text is displayed in the body of the email.  I do not want this, I just want to show the name of the file such as MyLetter.doc or AnotherRamble.doc etc. 
    I use the doc extension because those on one of the other operating systems may not be able to read .pages extensions. 
    I may from time to time send files with the .xls extensions and more recently I have just sent 20 x A4 pages of scanned documents which have .jpg extensions, every one of these .jpg attachments is displayed in full in the body of the email, it makes them difficult to read and hard to print.  The original plan was to send 20 x .jpg, the recipient would print them out.  There is some complex data in these documents and honestly hard copies are essential at the other end.

    Control click or Right Click on the attachment in the body of the email and select 'View as icon'.
    There is a (paid for) mail plugin called Attachment Tamer which helps Mail do a much better of handling attachments - giving much more control over how they are viewed/arranged/received. It's available from http://lokiware.info/Attachment-Tamer
    (Usual caveat, I've no connection with Lokiware, just happy with their product).

  • Can we send attachments in workflow email notifications ?

    Hi All,
    I have a requirement where attachment needs to be added in the workflow email notification. Can we do that in SAP ?
    If you know any pointers then please reply.
    Thanks & Regards.
    Raman Khurana.

    Hi raman,
      Please check
    Attachments in Workflow.
    Thanks,
    sahiba

  • HELP - I need to send copies of 200 emails without printing them

    I hope somebody can help.
    I have approx 200 emails in a folder in Mail. I need to get copies to somebody to read them as individual emails in date order. Obviously one option is to print each and put them in a file in date order but this would mean a huge amount of printing. Ideally I would like to burn them into a disc or put them on a memory stick that could be given to the other person for them to then be able to open each email and read through them. I have discovered the forward as attachement option in Mail. This almost dos what i need as it produces a file for each email that can be sent as an attachment. Can these files be saved and then copied to a disc or memory stick?

    If you select all of the emails you want, then choose save as… from the File menu, it will save them as rich text format (rtf), raw message source, or plain text. Both rtf and plain text only saves the content. raw message source contains all the headers and such, but is not really human readable and I couldn't get mail to open that file.
    Now, each of the emails is stored as a file inside your username/Library/Mail folder. They would be easier to find if you created a new mailbox in Mail and moved them into that mailbox. Then they would be inside of username/Library/Mail/Mailboxes/mailboxname/mailboxname.mbox
    You could then attach all of those files to a message.

  • Need to send HTML table via email

    Hi Experts,
    I am using the FM EFG_GEN_SEND_EMAIL to send email but unable to send html content through this. I know I could use SO_SEND_OBJECT FM too which automatically sends the email in HTML format but it doesn't have from option(FROM EMAIL ID)
    I tired manually chaning the format from RAW to HTM via debugging and then found that its sending the html format email.
    Request you to please let me know if we could achieve the same.
    Thanks,
    Rajwin

    Hi,
    rcently we idd this requirment .
    But every thing we did it from ABAP side   not from WDJ Side
    Generation of PDF after enterring the data will be send via email along with PDF Data so try to use  Smart Forms
    Regards,
    Govindu

  • Need to send question to differant email address

    I am having a problem signing in to my account. I have been using thunderbird for some time now. Yesterday it stopped refreshing with new mail. When I manually tried to refresh a screen pops up asking for my password to log in. I put in my password and it states it is not correct. The email address that I am having trouble with is [email protected] Any suggestions Thanks Art Blom

    In order to be able to find the correct solution to your problem, we require some more non-personal information from you. Please do the following:
    *Click the Firefox button at the top left, then click the ''Help'' menu and select ''Troubleshooting Information'' from the submenu. If you don't have a Firefox button, click the Help menu at the top and select ''Troubleshooting Information'' from the menu.
    Now, a new tab containing your troubleshooting information should open.
    *At the top of the page, you should see a button that says "Copy text to clipboard". Click it.
    *Now, go back to your forum post and click inside the reply box. Press Ctrl+V to paste all the information you copied into the forum post.
    If you need further information about the Troubleshooting information page, please read the article [[Use the Troubleshooting Information page to help fix Firefox issues]].
    Thanks in advance for your help!

  • Sender Name in The Email Functio Module

    Hi All,
    I have a requirement to change the sender name in the function module SO_NEW_DOCUMENT_SEND_API1 .
    By Default this function module takes the name of the sender from the log in id .
    Please suggest how I can do it...
    Thnks ...
    sahil

    Hi sahiil,
    I_OBJTXT = 'Find attached the output of the smartform.'.
    APPEND I_OBJTXT.
    I_OBJTXT = 'Regards,'.
    APPEND I_OBJTXT.
    I_OBJTXT = '  '.-----> sender name
    APPEND I_OBJTXT.
    Regards,
    Sravanthi

Maybe you are looking for

  • SQL developer not showing compiler warnings

    I'm just testing out the new compiler warning contained in 11g related to the "when others" exception handler when it does not have a subsequent raise or raise_application_error. in SQL plus, this works fine: SQL> alter session set plsql_warnings='en

  • Value does not fall within expected range in client object model SharePoint online

    Hi, I might be missing something, at least i hope so because I don't see it anymore. Yes, I used the search, and yes many had the same error, but I think my problem has to be something else. It is not size related but more context related i think. I'

  • Max size of iBook, ePub images

    Trying to create an eBook with illustrations. Sometime a pic appears on two pages. Is there a stated, maximum size (dpi) for images, so they don't appear on two pages? Is there a way to control things like having caption always appear with pic? The r

  • Tomcat 6.0 is not working it is giving following error, can anybody help me

    Windows could not start apache tomcat on local computer. For more information review the system event log . If this is a non microsoft service contact the service vendor & refer to service specific error code 0.

  • Wrong Number of Songs On My iPod Shown/Incorrect Album Art

    I have two things that are wrong with my iPod Touch 4G that are bugging me and I don't know what to do about them. One thing is that the number of songs I have on my iPod is incorrect. When I go into the Settings menu > General > About it currently s