UTL_SMTP mail with an attachment (problem by attaching the zip file)

Hi all

I used the code for sending email with attachment below. but when I try to add the body of the message its does not work in the sense of sound do not attach my file. When I commented that border its attach the file.
commented lines:
 -- utl_smtp.write_data(mail_conn,UTL_TCP.CRLF ||'Body' ||':'|| text || UTL_TCP.CRLF);

  --utl_smtp.write_data(mail_conn,UTL_TCP.CRLF||text || UTL_TCP.CRLF );
How to solve this problem?

Full procedure.
create or replace
procedure sssl_send_mail (
      p_sender varchar2,
      p_recipient varchar2,
      p_cc varchar2,
      p_subject varchar2,
      p_filename varchar2,
      text varchar2) is     
    --c utl_smtp.connection;
    v_raw raw(57);
    v_length integer := 0;
    v_buffer_size integer := 57;
    v_offset integer := 1;
    mailhost    VARCHAR2(64) := 'xxxxxxxxxx';
    port constant number(2):=25;
    timeout number :=180;
    mail_conn  utl_smtp.connection;   
 p_blob Blob;
 temp_os_file bfile;
 ex number;  
begin  
   DBMS_LOB.CREATETEMPORARY(p_blob,true);
   temp_os_file := BFILENAME ('xxxxxxxx',p_filename);
   ex := dbms_lob.fileexists(temp_os_file);
      if ex = 1 then
         dbms_lob.fileopen(temp_os_file, dbms_lob.file_readonly);
         dbms_lob.loadfromfile(p_blob,temp_os_file, dbms_lob.getlength(temp_os_file));
         dbms_lob.fileclose(temp_os_file);
       end if;
   mail_conn := utl_smtp.open_connection(mailhost, port,timeout);
   utl_smtp.helo(mail_conn, mailhost);
   utl_smtp.mail(mail_conn, p_sender);
   utl_smtp.rcpt(mail_conn, p_recipient);
   utl_smtp.rcpt(mail_conn, p_cc);


   utl_smtp.open_data(mail_conn);
  utl_smtp.write_data(mail_conn,'From'||':'|| p_sender || UTL_TCP.CRLF);
  utl_smtp.write_data(mail_conn,'To'||':'|| p_recipient || UTL_TCP.CRLF);
  utl_smtp.write_data(mail_conn,'CC'||':'|| p_cc || UTL_TCP.CRLF);


  utl_smtp.write_data(mail_conn,'Subject' ||':'|| p_subject || UTL_TCP.CRLF);

 -- utl_smtp.write_data(mail_conn,UTL_TCP.CRLF ||'Body' ||':'|| text || UTL_TCP.CRLF);

  --utl_smtp.write_data(mail_conn,UTL_TCP.CRLF||text || UTL_TCP.CRLF );



    utl_smtp.write_data( mail_conn, 'Content-Disposition: attachment; filename="' || p_filename || '"' || utl_tcp.crlf);
    utl_smtp.write_data( mail_conn, 'Content-Transfer-Encoding: base64' || utl_tcp.crlf );
    utl_smtp.write_data( mail_conn, utl_tcp.crlf ); 
    v_length := dbms_lob.getlength(p_blob);     
    <<while_loop>>
    while v_offset < v_length loop
      dbms_lob.read( p_blob, v_buffer_size, v_offset, v_raw );
      utl_smtp.write_raw_data( mail_conn, utl_encode.base64_encode(v_raw) );
      utl_smtp.write_data( mail_conn, utl_tcp.crlf );
      v_offset := v_offset + v_buffer_size;
    end loop while_loop;
    utl_smtp.write_data( mail_conn, utl_tcp.crlf );
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
  exception
    when utl_smtp.transient_error or utl_smtp.permanent_error then
      utl_smtp.quit(mail_conn);
      raise;
    when others then
    raise;
  end;
Please, help me to solve this problem.

Thanks in advance.

See you soon,.
Shan.

Published by: Shan on January 13, 2011 13:08

Published by: Shan on January 14, 2011 15:22

I don't have your question on the BLOB store. I read the disk file (BFILE) and then storing it in temporary LOB. I send a file in my hotmail and it came as an attachment.

DECLARE
  /*LOB operation related varriables */
  v_src_loc  BFILE := BFILENAME('SAUBHIK', 'Waterlilies.jpg');
  l_buffer   RAW(54);
  l_amount   BINARY_INTEGER := 54;
  l_pos      INTEGER := 1;
  l_blob     BLOB := EMPTY_BLOB;
  l_blob_len INTEGER;
  v_amount   INTEGER;

  /*UTL_SMTP related varriavles. */
  v_connection_handle  UTL_SMTP.CONNECTION;
  v_from_email_address VARCHAR2(30) := '[email protected]';--change your email address
  v_to_email_address   VARCHAR2(30) := '[email protected]'; --change your email address
  v_smtp_host          VARCHAR2(30) := '9.182.156.144'; --My mail server, replace it with yours.
  v_subject            VARCHAR2(30) := 'Your Test Mail';
  l_message            VARCHAR2(200) := 'This is test mail using UTL_SMTP';

  /* This send_header procedure is written in the documentation */
  PROCEDURE send_header(pi_name IN VARCHAR2, pi_header IN VARCHAR2) AS
  BEGIN
    UTL_SMTP.WRITE_DATA(v_connection_handle,
                        pi_name || ': ' || pi_header || UTL_TCP.CRLF);
  END;

BEGIN
  /*Preparing the LOB from file for attachment. */
  DBMS_LOB.OPEN(v_src_loc, DBMS_LOB.LOB_READONLY); --Read the file
  DBMS_LOB.CREATETEMPORARY(l_blob, TRUE); --Create temporary LOB to store the file.
  v_amount := DBMS_LOB.GETLENGTH(v_src_loc); --Amount to store.
  DBMS_LOB.LOADFROMFILE(l_blob, v_src_loc, v_amount); -- Loading from file into temporary LOB
  l_blob_len := DBMS_LOB.getlength(l_blob);

  /*UTL_SMTP related coding. */
  v_connection_handle := UTL_SMTP.OPEN_CONNECTION(host => v_smtp_host);
  UTL_SMTP.HELO(v_connection_handle, v_smtp_host);
  UTL_SMTP.MAIL(v_connection_handle, v_from_email_address);
  UTL_SMTP.RCPT(v_connection_handle, v_to_email_address);
  UTL_SMTP.OPEN_DATA(v_connection_handle);
  send_header('From', '"Sender" <' || v_from_email_address || '>');
  send_header('To', '"Recipient" <' || v_to_email_address || '>');
  send_header('Subject', v_subject);

  --MIME header.
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      'MIME-Version: 1.0' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      'Content-Type: multipart/mixed; ' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      ' boundary= "' || 'SAUBHIK.SECBOUND' || '"' ||
                      UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);

  -- Mail Body
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      '--' || 'SAUBHIK.SECBOUND' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      'Content-Type: text/plain;' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      ' charset=US-ASCII' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle, l_message || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);

  -- Mail Attachment
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      '--' || 'SAUBHIK.SECBOUND' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      'Content-Type: application/octet-stream' ||
                      UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      'Content-Disposition: attachment; ' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      ' filename="' || 'Waterlilies.jpg' || '"' || --My filename
                      UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      'Content-Transfer-Encoding: base64' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);

  /* Writing the BLOL in chunks */
  WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.READ(l_blob, l_amount, l_pos, l_buffer);
    UTL_SMTP.write_raw_data(v_connection_handle,
                            UTL_ENCODE.BASE64_ENCODE(l_buffer));
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    l_buffer := NULL;
    l_pos    := l_pos + l_amount;
  END LOOP;
  UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);

  -- Close Email
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      '--' || 'SAUBHIK.SECBOUND' || '--' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,
                      UTL_TCP.CRLF || '.' || UTL_TCP.CRLF);

  UTL_SMTP.CLOSE_DATA(v_connection_handle);
  UTL_SMTP.QUIT(v_connection_handle);
  DBMS_LOB.FREETEMPORARY(l_blob);
  DBMS_LOB.FILECLOSE(v_src_loc);

EXCEPTION
  WHEN OTHERS THEN
    UTL_SMTP.QUIT(v_connection_handle);
    DBMS_LOB.FREETEMPORARY(l_blob);
    DBMS_LOB.FILECLOSE(v_src_loc);
    RAISE;
END;

http://saubbane.blogspot.com/2011/01/sending-binary-attachmentimages-in-mail.html

Tags: Database

Similar Questions

  • problem by opening the Zip file

    I have 8.0 Zip when I create a zip file and open the zip file all show but open in notped.

    The possible Zip files were dissasociated and rather associated with Notepad.  Go to start / Default programs / high a file or program with a Protocol / and go to .zip files.  It shows probably associated with Notepad.  Go to the following link: http://www.mydigitallife.info/2008/06/22/reset-and-fix-broken-windows-vista-file-ext-and-type-associations-include-exe-com-sys-zip-lnk-folder-drive/ and select the zip file option file and run it to reset the association of zip files.

    If this does not work, install 7-Zip http://www.7-zip.org/ one good program free Zip.  This should establish associate files with 7-Zip Zip (OK this action if requested).  Then, use 7 - Zip to open the Zip file.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Send an E-mail with an attachment procedure Oracle

    Jin

    I have the procedure to send e-mail with excel attachment
    The data in the Excel file are built by using the query in my procedure. Send mail with attachment, it works well.
    Now the situation is if there is no data in the Excel worksheet that is built dynamically, we limit the sending of email
    is that possible, please let me know,
    Am using the utl_tcp method to build the excel file

    Thank you
    Vel

    Something like that? But I have not tested. Please test carefully.

    PROCEDURE GCN_ORDER(errbuf OUT VARCHAR2, retcode OUT VARCHAR2) IS
      rc          integer;
      crlf        VARCHAR2(2) := CHR(13) || CHR(10);
      mesg        VARCHAR2(1000);
      c           utl_tcp.connection;
      L_FROM_DATE DATE;
      L_TO_DATE   DATE;
    
      msg_from        VARCHAR2(100) := '[email protected]';
      to_addresses    VARCHAR2(1000);
      cc_addresses    VARCHAR2(1000);
      email_addresses VARCHAR2(2000);
      msg_subject     VARCHAR2(200) := 'E-mail Alert: ';
      msg_text1       VARCHAR2(15) := 'Dear Sir,';
      msg_text2       VARCHAR2(500) := 'Please find the attached file,';
      msg_text3       VARCHAR2(25) := 'Division';
      msg_text4       VARCHAR2(25) := 'For the period : ';
      v_mail_to       VARCHAR2(1000);
      lv_gcn          varchar2(1000);
    
      next_column            number;
      recipient_email_length number;
      single_recipient_addr  varchar2(100);
    
      v_is_there_any_attachment CHAR(1):='N'; --New var.
    
      cursor cur_select(L_FROM_DATE DATE, L_TO_DATE DATE) is
        SELECT (substr(wdd.source_header_type_name, 5) || ',' ||
               oha.order_number || ',' || wdd.attribute1 || ',' ||
               TO_DATE(wdd.attribute2, 'dd/mm/rrrr') || ',' ||
               TO_DATE(oha.creation_date, 'dd/mm/rrrr') || ',' ||
               TO_DATE(ola.creation_date, 'dd/mm/rrrr') || ',' ||
               ola.ordered_item) gcn
          FROM apps.oe_order_headers_all oha,
               apps.oe_order_lines_all   ola,
               apps.wsh_delivery_details wdd
         WHERE oha.org_id = 92
           AND oha.org_id = ola.org_id
           AND oha.header_id = ola.header_id
           AND wdd.inventory_item_id = ola.inventory_item_id
           AND wdd.source_header_number = oha.order_number
           AND wdd.source_line_id = ola.line_id
           AND wdd.org_id = oha.org_id
           AND wdd.attribute_category = '92Freight'
           AND TO_DATE(wdd.attribute2, 'dd/mm/rrrr') <
               TO_DATE(ola.creation_date, 'dd/mm/rrrr')
           AND TO_DATE(wdd.attribute2, 'dd/mm/rrrr') BETWEEN L_FROM_DATE AND
               L_TO_DATE
           AND oha.flow_status_code NOT IN ('BOOKED', 'ENTERED');
    
      cursor cur_to_email is
        SELECT email_address
          FROM alert_users_ID
         WHERE org_id IN (1, 92)
           AND status_flag = 'Y'
           AND report_id = 3
           AND MAIL_TYPE = 'To'
           AND (module = 'AR' OR module IS NULL);
    
      cursor cur_cc_email is
        SELECT email_address
          FROM alert_users_ID
         WHERE org_id IN (1, 92)
           AND status_flag = 'Y'
           AND report_id = 3
           AND MAIL_TYPE = 'Cc'
           AND (module = 'AR' OR module IS NULL);
    
    BEGIN
    
      --FROM AND TO DATE LOGIC
      select MIN(START_DATE), MAX(END_DATE)
        INTO L_FROM_DATE, L_TO_DATE
        from apps.gl_period_statuses
       where closing_status = 'O'
         AND APPLICATION_ID = 101
         AND SET_OF_BOOKS_ID = 2;
    
      for c_to in cur_to_email loop
        to_addresses := to_addresses || ',' || c_to.email_address;
      end loop;
    
      to_addresses := ltrim(to_addresses, ',');
    
      for c_cc in cur_cc_email loop
        cc_addresses := cc_addresses || ',' || c_cc.email_address;
      end loop;
    
      cc_addresses := ltrim(cc_addresses, ',');
    
      email_addresses := to_addresses || ',' || cc_addresses;
    
      recipient_email_length := length(email_addresses);
      email_addresses        := email_addresses || ','; -- Add comma for the last asddress
      next_column            := 1;
      if instr(email_addresses, ',') = 0 then
        -- Single E-mail address
        single_recipient_addr  := email_addresses;
        recipient_email_length := 1;
      end if;
    
      c := utl_tcp.open_connection(remote_host => '127.0.0.1',
                                   remote_port => 25,
                                   tx_timeout  => null);
    
      rc := utl_tcp.write_line(c, 'HELO 127.0.0.1');
      rc := utl_tcp.write_line(c, 'EHLO 127.0.0.1');
    
      rc := utl_tcp.write_line(c, 'MAIL FROM: ' || msg_from);
    
      while next_column <= recipient_email_length loop
        -- Process Multiple E-mail addresses in the loop OR single E-mail address once.
        single_recipient_addr := substr(email_addresses,
                                        next_column,
                                        instr(email_addresses, ',', next_column) -
                                        next_column);
        next_column           := instr(email_addresses, ',', next_column) + 1;
    
        --rc := utl_tcp.write_line(c, 'MAIL FROM: '||msg_from);
        rc := utl_tcp.write_line(c, 'RCPT TO: ' || single_recipient_addr);
      end loop;
      rc := utl_tcp.write_line(c, 'DATA');
      rc := utl_tcp.write_line(c,
                               'Date: ' ||
                               TO_CHAR(SYSDATE, 'dd Mon yy hh24:mi:ss'));
      rc := utl_tcp.write_line(c,
                               'From: ' || msg_from || ' <' || msg_from || '>');
      rc := utl_tcp.write_line(c, 'MIME-Version: 1.0');
      rc := utl_tcp.write_line(c, 'To: ' || to_addresses);
      rc := utl_tcp.write_line(c, 'Cc: ' || cc_addresses);
      rc := utl_tcp.write_line(c, 'Subject: ' || msg_subject);
      rc := utl_tcp.write_line(c, 'Content-Type: multipart/mixed;');
      rc := utl_tcp.write_line(c, ' boundary="-----SECBOUND"');
      rc := utl_tcp.write_line(c, '');
      rc := utl_tcp.write_line(c, '-------SECBOUND');
      rc := utl_tcp.write_line(c, 'Content-Type: text/plain');
      rc := utl_tcp.write_line(c, 'Content-Transfer-Encoding: 7bit');
      rc := utl_tcp.write_line(c, '');
      rc := utl_tcp.write_line(c, msg_text1);
      rc := utl_tcp.write_line(c, ' ');
      rc := utl_tcp.write_line(c, msg_text2);
      rc := utl_tcp.write_line(c, ' ');
      rc := utl_tcp.write_line(c, msg_text3);
      rc := utl_tcp.write_line(c,
                               msg_text4 || to_char(l_from_date, 'MON-YY') ||
                               ' to ' || to_char(l_to_date, 'MON-YY'));
      rc := utl_tcp.write_line(c, '');
      rc := utl_tcp.write_line(c, '-------SECBOUND');
      rc := utl_tcp.write_line(c, 'Content-Type: text/plain;');
      rc := utl_tcp.write_line(c, ' name="GCN_Details.csv"');
      rc := utl_tcp.write_line(c, 'Content-Transfer_Encoding: 8bit');
      rc := utl_tcp.write_line(c, 'Content-Disposition: attachment;'); --Indicates that this is an attachment.
      rc := utl_tcp.write_line(c, ' filename="GCN_Details.csv"');
      rc := utl_tcp.write_line(c, '-------SECBOUND');
      rc := utl_tcp.write_line(c, '');
      begin
    
        -- WRITE COLUMN HEADERS
        rc := utl_tcp.write_text(c, 'BRANCH' || ',' || 'ORDER NUMBER');
        rc := utl_tcp.write_line(c, ' ');
    
        for c1 in cur_select(L_FROM_DATE, L_TO_DATE) loop --You are starting to write the data
          lv_gcn := c1.gcn;
          rc     := utl_tcp.write_text(c, lv_gcn);
          rc     := utl_tcp.write_line(c, ' ');
          v_is_there_any_attachment:='Y';--Is there any data ?
        end loop;
    
      exception
        when others then
          dbms_output.put_line('error : ' || sqlerrm);
          rc := utl_tcp.write_text(c, 'Data Error');
      end;
      If v_is_there_any_attachment ='Y' THEN
         rc := utl_tcp.write_line(c, '');
         rc := utl_tcp.write_line(c, '.');
         rc := utl_tcp.write_line(c, '-------SECBOUND');
      --end loop;
      END If;
      rc := utl_tcp.write_line(c, 'QUIT');
      dbms_output.put_line(utl_tcp.get_line(c, TRUE));
      utl_tcp.close_connection(c);
    EXCEPTION
      when others then
        utl_tcp.close_connection(c);
        raise_application_error(-20000, SQLERRM);
    END GCN_ORDER;
    
  • Sending mail with an attachment using UTL_SMTP

    Hi all

    I'm working on a PL/SQL code, where do I send a mail with an attachment using UTL_SMTP. I use the following code, I changed the value of p_to and p_from

    DECLARE

    l_mail_conn UTL_SMTP.connection;

    l_boundary VARCHAR2 (50): = '-= * #abc1234321cba #* =';

    l_step PLS_INTEGER: = 12000; -Make sure you define a multiple of 3 would not exceed the 24573

    p_to VARCHAR2 (100): = ' [email protected] ';

    p_from VARCHAR2 (100): = ' [email protected] ';

    p_subject VARCHAR2 (100): = "UPLOAD of FILE MAIL."

    p_text_msg VARCHAR2 (100): = 'it is a system generated email';

    p_attach_name VARCHAR2 (100);

    p_attach_mime VARCHAR2 (100);

    p_attach_blob BLOB;

    p_smtp_host VARCHAR2 (100): = 'localhost ';

    p_smtp_port NUMBER: = 25;

    BEGIN

    l_mail_conn: = UTL_SMTP.open_connection (p_smtp_host, p_smtp_port);

    UTL_SMTP. HELO (l_mail_conn, p_smtp_host);

    UTL_SMTP.mail (l_mail_conn, p_from);

    UTL_SMTP. RCPT (l_mail_conn, p_to);

    UTL_SMTP.open_data (l_mail_conn);

    UTL_SMTP.write_data (l_mail_conn, ' Date: ' |) TO_CHAR (SYSDATE, ' ' DD-MON-YYYY HH24:MI:SS) | UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' from: ' | p_to |) UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' from: ' | p_from |) UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' subject: ' | p_subject |) UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' Reply-To: ' | p_from |) UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, "MIME-Version: 1.0 ' |") UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' Content-Type: multipart/mixed; limit = "" | ") l_boundary | '"' || UTL_TCP. CRLF. UTL_TCP. CRLF);

    IF p_text_msg IS NOT NULL THEN

    UTL_SMTP.write_data (l_mail_conn, '-' | l_boundary |) UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' Content-Type: text/plain; charset = "iso-8859-1" ' |) UTL_TCP. CRLF. UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, p_text_msg);

    UTL_SMTP.write_data (l_mail_conn, UTL_TCP.crlf |) UTL_TCP. CRLF);

    END IF;

    IF p_attach_name IS NOT NULL THEN

    FOR I IN (SELECT *)

    OF xx_mail_test_table

    WHERE ROWNUM = 1

    ORDER BY last_update_date DESC) LOOP

    UTL_SMTP.write_data (l_mail_conn, '-' | l_boundary |) UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' Content-Type: ' | p_attach_mime |) '; name =' ' | I.FILE_NAME | '"' || UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, "Content-Transfer-Encoding: base64' |") UTL_TCP. CRLF);

    UTL_SMTP.write_data (l_mail_conn, ' Content-Disposition: attachment; filename = "" | ") I.FILE_NAME | '"' || UTL_TCP. CRLF. UTL_TCP. CRLF);

    FOR J FROM 0... TRUNC ((DBMS_LOB. GetLength (I.file_name) - 1) / l_step) LOOP

    UTL_SMTP.write_data (l_mail_conn, UTL_RAW.cast_to_varchar2 (UTL_ENCODE.base64_encode (DBMS_LOB.substr (I.FILE_NAME, l_step, J * l_step + 1)));)

    END LOOP;

    UTL_SMTP.write_data (l_mail_conn, UTL_TCP.crlf |) UTL_TCP. CRLF);

    END LOOP;

    END IF;

    UTL_SMTP.write_data (l_mail_conn, '-' | l_boundary |) '--' || UTL_TCP. CRLF);

    UTL_SMTP.close_data (l_mail_conn);

    UTL_SMTP. Quit (l_mail_conn);

    EXCEPTION

    WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN

    UTL_SMTP. Quit (l_mail_conn);

    lift;

    WHILE OTHERS THEN

    dbms_output.put_line (SQLERRM);

    END;

    This is when I execute the block that I get 2 mails to the same but there are some attachments, I checked the table and he gave.

    Could someone help me as to where I'm wrong?

    Create the raw DATA for the SMTP protocol can be tricky.

    I cheat and use a package that has been designed to do easily.

    APEX_MAIL

    MK

  • redirect e-mail with photos attached

    When you try to send an e-mail with an attached picture in live mail, I get a notice on the screen that live mail cannot

    find photos in the e-mail message.  Transmitted without, he is received with an empty box with an x in the top left corner, but

    No picture.  This is not consistent with each email, which cannot live mail search image when it appears on my

    perfectally screen?

    Submit all Live and Hotmail queries on the forum right here:

    Windows Live Solution Center
    http://windowslivehelp.com/

  • Sending E-Mail with an attachment using PL/SQL

    Hello

    I am trying to send an E-Mail with an attachment using pl/sql on Oracle 9i.
    I found the code from the link below.
    http://www.orafaq.com/wiki/Send_mail_from_PL/SQL
    but the attachment it sends is defined in the pl/sql block.
    I want to attach a file in a different location. How can I do this?

    Thanks in advance

    If the attachment is also on the server (it must be on the server), you can load into a BLOB and which attach to your e-mail (you will need to create an Oracle Directory that points to the file to be attached).

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:255615160805 #68529763836665
    This thread is big enough, a ctrl + f there might give you some clues.

    Currently I do not have the mail api available on here, but I still have it on a "test/playground DB", so I'll take a look later, when I have time and place.

  • need help, can not attach the image file to my yahoo mail.

    need help, trying to compose e-mail... can not attach the image file to my yahoo mail... using firefox. Vista starter edition

    using 3 G hsdpa usb modem, model huawei E156G

    download stats is 0.00 KB its not not download, http://img337.imageshack.us/img337/2547/3ginterface.jpg

    the strange thing is that if I only download small file/pic as 50 KB download data passes through, but as 1 MB image file or more it will not pass and remained at 0.00 kb

    I tried to run administrator (always on the standard user account)---> cmd---> ipconfig/flushdns, still the same problem.

    Hi korgmeister,

    1 when was the last time it was working fine?

    2. do you have security software installed on the computer?

    3. are you able to access all Web sites?

    First of all, I suggest that you try to download the file with Windows internet explore.

    If you are able to download using Windows internet explore, then there may be a problem with the Firefox browser.

    Uninstall and reinstall Firefox browser and check.

    If you are facing a similar issue when you use Internet explore, then it may be Internet problem try to download some other file or document check if it works.

    Also contact your internet service provider to check if the connection side there is fine.

    Go back with the results!

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • I opened 2 emails that were in the folder spam from my email and that each contained an attachment zip 2 k and 3 KB. As I could not open directly in my email, I opened the zip files with the "open in" another app option. At the opening of th

    I opened 2 emails that were in the folder spam from my email and that each contained an attachment zip 2 k and 3 KB. As I could not open directly in my email, I opened the zip files with the "open in" another app option. When you open the zip files at this other app asked me if I wanted to extract zip files in a new folder, I have accepted, in both files .js (javascript) files there. I opened these .js inside this same application files and content files white text on black background and that seems to be a script file. My question is: my iPad Air has been compromised by a scam of viruses, such as the Trojan horse thieves and banking password especially as Dridex or Dyreza, the Trojans and ransomware as Locky, cryptolocker, or Teslacrypt. If that were the case, then what is the solution to get rid of these... Thank you.

    Simply delete them. It is not possible to install anything on iOS using this method. For good measure, you can remove and reinstall the application allowing you to open it with, but I don't really have that is actually needed.

  • How can I re - attach the data files for the programs?

    Original title:

    reconnection of the files

    BONE had to be reinstalled.  All data is saved but lost programs.  Programs now reinstalled, but how can I re - attach the data files for the programs?

    Hello

    You copy the data on your computer (Documents, Photos, etc.) and file extensions should be automatically associated with programs they have written in.

    Otherwise:

    "Changing programs by default by using Set Program Access and defaults of the computer"

    http://Windows.Microsoft.com/en-us/Windows/set-program-access-computer-defaults#1TC=Windows-7

    "How to change file Associations in Windows 7 and Windows 8.

    http://www.7tutorials.com/how-associate-file-type-or-protocol-program

    See you soon.

  • problem in the zip file and tutorial. can someone remove or correct...

    Hi experts jdev,.

    use jdev11.1.1.5.0.

    When I am new on this webservice. I followed this tutorial
    http://docs.Oracle.com/CD/E18941_01/tutorials/jdtut_11r2_14/jdtut_11r2_14.html

    wsdl URL link when using that wsdl.

    throws an error.
    What is the reason, said john. OK at the second post of the thread.
    Consume a Web Service from a Web Page

    so if I change the wsdl means somethings should be changed in steps tutorial.

    If any newbie crossing this tutorials feels very difficult to work. so I can change the wsdl url link and these steps.

    and another thing, as I installed 11.1.2.0 and download zip file in this tutorial and I run up the same error.

    so. problem in the zip file and tutorial. any person may file or correct...

    I think it's the right place to say this. Otherwise, re - direct me.

    It's yours if you want to close. I ping the folks at Oracle.

  • Cannot forward the e-mail with an attachment

    I use att.net as my email, I can send emails fine and can reply and forward emails (which have no binding) but I can't send an email that has an attachment)

    It keeps saying ' att.net Mail found the original e-mail, but met with some display problems. Please try again later. "

    It works now, not sure what happened unless ATT knew the problem on Chrome and the fixed

  • How to create a job that e-mail with csv attached.

    Hello

    Could all help with that.

    I have a trigger that inserts (after changing the DLL) on the diagram at track_t, (table).

    Now, I put a job to convert track_t (table) to CSV data, daily...

    Then, I need to define a job to send the mail on a daily basis with the attached csv.

    set - trigger, procedue to send mail. But how to create a job to send a mail with csv generated

    8ff4363d-844d-49fd-87D1-2125143d11a8 wrote:

    Hello

    Could all help with that.

    I have a trigger that inserts (after changing the DLL) on the diagram at track_t, (table).

    Now, I put a job to convert track_t (table) to CSV data, daily...

    Then, I need to define a job to send the mail on a daily basis with the attached csv.

    set - trigger, procedue to send mail. But how to create a job to send a mail with csv generated

    DBMS_SCHEDULER

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25788/d_sched.htm#ARPLS72235

  • delete file after sending an e-mail with an attachment

    Hello

    I looked in the forums and have not found any reference to it.
    I need to send an email with an attachment that is source via a form.

    The problem I'm having is that when I include the code to remove the file from the directory, the intrusion via cfmail is unable to run. When I do not include the code to delete the file, it works fine.
    Any ideas?

    I tried with paths, physical and virtual.

    You need give time for email to send.

    Figure 60 seconds or 60 seconds more your spool interval (if the coil is on (on))-whichever is greater.

    It would be preferable not to delete the file here.

    Set up a scheduled task that deletes files in the target directory that are, say, older than 24 hours.

  • When I receive e-mails with an attachment can not open, it says: Windows media player cannot access the file, Please HELP

    WHEN I RECEIVE AN EMAIL WITH AN ATTACHMENT I CAN'T OPEN IT. IT SAYS WINDOWS MEDIA PLAYER CANNOT ACCESS THE FILE.

    Help, please

    How this is related to Windows Update, John?

  • Sending mail with an attachment of the IOM

    Hi Experts,

    We have an obligation to send an email with an attachment of the IOM. Unable to find any relevant document how this goal using the model Notification and NotificationService.

    Any help would be appreciated.

    Thanks in advance.

    This feature is not supported by the product. check the Doc ID 1444359.1

    You can trigger an SR to know about this.

Maybe you are looking for