UTF-8 special character in utl-smtp

Hi, I'm trying to send out an email which has special characters in the body and in the subject like. I have tried all sort of methods to solve my problem. In the code below I have underlined the methods that I have tried. But all of them result in "?????" I'm running on 11g. can you please let me know what I can do to resolve this problem.
CREATE OR REPLACE PROCEDURE PR_SEND_EMAIL
  ( p_from_email_address   VARCHAR2
  , p_to_email_address     VARCHAR2
  , p_smtp_host            VARCHAR2
  , p_subject              VARCHAR2
  , p_message              VARCHAR2
IS
  /*Your query as cursor */
  CURSOR emp_cur IS
    SELECT * FROM a_tre_alert;
  /*UTL_SMTP related varriavles. */
  v_connection_handle  UTL_SMTP.CONNECTION;
  /* 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
  /*UTL_SMTP related coding. */
  v_connection_handle := UTL_SMTP.OPEN_CONNECTION(host => p_smtp_host);
  UTL_SMTP.HELO(v_connection_handle, p_smtp_host);
  UTL_SMTP.MAIL(v_connection_handle, p_from_email_address);
  UTL_SMTP.RCPT(v_connection_handle, p_to_email_address);
  UTL_SMTP.OPEN_DATA(v_connection_handle);
  send_header('From', '"Sender" <' || p_from_email_address || '>');
  send_header('To', '"Recipient" <' || p_to_email_address || '>');
  send_header('Subject', p_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;charset=utf-8' || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle, 'Content-Transfer-Encoding: quoted-printable'|| UTL_TCP.CRLF);
-- UTL_SMTP.WRITE_DATA(v_connection_handle, 'Content-Transfer-Encoding:  8bit' || UTL_TCP.crlf);
-- UTL_SMTP.WRITE_RAW_DATA(v_connection_handle, utl_encode.base64_encode(utl_raw.cast_to_raw(p_message))|| UTL_TCP.CRLF);
  UTL_SMTP.write_raw_data(v_connection_handle, UTL_RAW.CAST_TO_RAW(p_message));
  UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
-- UTL_SMTP.write_raw_data(v_connection_handle, UTL_RAW.cast_to_raw(UTL_TCP.crlf ||p_message));
  --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, p_message || UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
  UTL_SMTP.WRITE_DATA(v_connection_handle,'Due Date--Amount--State--ChkSerial--APSerial--AccountCode--FloatAccountتست'|| UTL_TCP.CRLF);
  FOR i IN emp_cur
  LOOP
    UTL_SMTP.WRITE_DATA(v_connection_handle,  i.chequedate || '--' || i.rialamount || '--' || i.state || '--' || i.check_serial || '--' || i.ap_serial || '--' || i.acc_code || '--' || i.facc_code || UTL_TCP.CRLF);
  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);
EXCEPTION
  WHEN OTHERS THEN
    UTL_SMTP.QUIT(v_connection_handle);
    RAISE;
END;
CREATE OR REPLACE PUBLIC SYNONYM PR_SEND_EMAIL FOR PR_SEND_EMAIL;
BEGIN
  PR_SEND_EMAIL ( p_from_email_address => '[email protected]'
                    , p_to_email_address   => '[email protected]'
                    , p_smtp_host          => 'xx.xxx.xx.x'
                    , p_subject            => 'SPECIAL CHAR'
                    , p_message            => 'SPECAIL CHAR'
EXCEPTION WHEN OTHERS
   THEN DBMS_OUTPUT.PUT_LINE('ERROR in Procedure PR_SEND_EMAIL - ' || SQLERRM);
        RAISE;
END;

Is using a trigger a wise idea???

Similar Messages

  • Xml publisher reprot - special character problem

    I invoice report through xml publisher. I have '&' special character in vendor list. I am getting below error
    A semi colon character was expected. Error processing resource.
    Below is the code
    CREATE OR REPLACE PACKAGE BODY XML_RPT AS
        FUNCTION XML_TAG (p_tag IN VARCHAR2, p_data IN VARCHAR2) RETURN VARCHAR2 IS
        l_ret_str VARCHAR2(5000);
        BEGIN
            l_ret_str := '<'||p_tag||'>'||p_data||'</'||p_tag||'>';
            RETURN l_ret_str;
        END XML_TAG;
         PROCEDURE VENDOR(errbuf          OUT  VARCHAR2,
                         retcode         OUT  NUMBER) IS
        CURSOR inv_Cur  IS
            select pv.vendor_name          
            from po_vendors pv;        
         xmldata            varchar2(1000);
         l_sqlstr           varchar2(1000);
         l_seqnum           varchar2(3);
         l_vendor_name      varchar2(100);
        BEGIN
          xmldata := '<?xml version="1.0" encoding="UTF-8"?>';     
          xmldata :=xmldata|| '<VENDOR>';
          xmldata := xmldata||' <LIST_VENDOR>';
          fnd_file.put_line(fnd_file.output,xmldata);    
          FOR rpt_rec IN inv_Cur LOOP
              xmldata := '<VENDOR_REC>';
              l_vendor_name := replace(rpt_rec.VENDOR_NAME,'&','&amp');         
              xmldata := xmldata || XXMCG_XML_TAG('VENDOR_NAME',L_VENDOR_NAME);
              xmldata :=xmldata|| '</VENDOR_REC>';
              fnd_file.put_line(fnd_file.output,xmldata);
          END LOOP;
          xmldata := '</LIST_VENDOR>';
          xmldata := xmldata||'</VENDOR>';
         fnd_file.put_line(fnd_file.output,xmldata);
        EXCEPTION
        WHEN OTHERS THEN
             fnd_file.put_line(fnd_file.log,substr(SQLERRM,1,500));
        END VENDOR;
    END XML_RPT;can any one advice.

    Duplicate post ? xml publisher report problem
    Srini

  • Need to prevent special character in generated XML file

    Hello,
    I am using E-business Suite 12.1.3 and XML version 5.6.3.
    My XML file is ending up with a special character (a Latin capital letter U with circumflex) at the end, after the final closing tag.
    Due to this the concurrent program that needs to output the XML is ending with warning.
    My XML file is produced using a PL/SQL procedure, as follows (I've simplified it):
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="UTF-8" ?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<DOCS>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<LETTER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<EMP_NAME>Michaela Hart</EMP_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</LETTER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</DOCS>');
    But when I run the concurrent request that creates the output then try to view the output in Internet Explorer I get the following error:
    Invalid at the top level of the document. Error processing resource 'http://servername.domain...
    </DOCS>
    If I view the source of the page in Internet Explorer it shows a square after </DOCS> indicating the special character that has been added.
    I checked this by looking at the output file in unix (cat -v o7766582.req) and it showed up the Latin U character.
    I realise it could be to do with the character set I am using. I checked what we had on the server:
    > echo $NLS_LANG
    American_America.UTF8
    I would have thought that corresponded with the XML declaration character set but I'm not sure.
    Does anyone have any other ideas about why I have this special character, and how it could be removed?
    Thanks in advance,
    Hazel

    Hi AlexAnd,
    thanks very much for your reply.
    I'm now unable to recreate the problem since dbms_xmlgen worked. If I switch back to my previous method it works fine!
    I'm not sure your suggestion would help, as there were no special characters in the data, the special character was added after the last tag I output. I hard coded the data (as in my example) for testing purposes so there was no SQL in use and the special character was still added at the end of the XML output. But I will definitely give it a try if I get the problem again.
    I had the idea that maybe I should have been using FND_FILE.PUT rather than FND_FILE.PUT_LINE but now the error is gone I can't tell if that would have solved the problem either.
    I appreciate your input.
    Regards
    Hazel

  • Special character no longer works after updates

    Hi,
    I updated my system yesterday and it broke something. My PS1 used to look like: http://imgur.com/a/GboiZ#0 , with a special - character.
    When I logged in today, my PS1 looked like this: http://imgur.com/a/GboiZ#2, and the line in my .bashrc with the filler looked like this: http://imgur.com/a/GboiZ#1.
    I already downgraded bash and xterm, what could have caused this? I also tried zsh for the first time yesterday, but that doesn't seem to be related, since when I download an old copy of the file, the character is still screwed up.
    Thanks in advance

    Stebalien wrote:
    What is the output of 'env'? Make sure that the LANG and the LC_* variables end in ".utf8".
    edit -- While you are at it, post your /etc/rc.conf, /etc/profile.d/locale.sh, and /etc/locale.gen.
    LANG is set to C, running locale outputs everything as C too. However, LOCALE in rc.conf is set to en_US.UTF-8
    locale.sh has:
    if [ -s /etc/rc.conf ]; then
    export LANG=$(. /etc/rc.conf 2> /dev/null ; echo "$LOCALE")
    else
    export LANG="C"
    fi
    which I guess is correct since LOCALE is set in rc.conf
    locale.gen has everything but en_US.UTF-8 UTF-8 and en_US ISO-8859-1 commented.
    listdata wrote:Excuse my sillyness, but you did change your .bashrc function back to actually use the correct special character, right?
    Yes

  • How to insert special character in sgm file and interprete it without isoents while opening in FM9.0

    I have an sgm file which contains special characters in different languages.
    <!DOCTYPE MANUAL PUBLIC "-//SWE-XXX//DTD XXX MANUAL-DTD 2.0//EN">
    <MANUAL LANG="CS">
    <TITEL>
    Polish characters: &oacute;&ecirc;&iquest;&ntilde;&aelig;&Ntilde;&AElig;&Ecirc;&yen;&Oacute;&pound;
    Czech characters: &eacute;&igrave;&oacute;&iuml;&aacute;&oslash;&egrave;&iacute;&ugrave;&ograve;&uacute;&Og rave;&Igrave;&Eacute;&Oacute;&Uacute;&Ugrave;&Egrave;&Oslash;&Iacute;&Aacute;&Iuml; aacute: &aacute;</TITEL>
    </MANUAL>
    Is there any way to insert special character directly in sgm file, so that it won't have to be interpreted by isoents mapping rules?
    isoent.rwr interpretes oacute as:
    entity "oacute" is fm char 0x00F3;
    But I would like to use 0x00F3 directly in fm file, so that if any additional character is needed - I won't have to update isoent files
    I've tested already:
    &#x00F3;
    &x00F3;
    &0x00F3;
    but with no luck
    Is there anyone who could help me with it?
    I will really appreciate your help
    /Joanna

    Hi Michael. Thank you for your reply.
    There is no declaration within sgm file itself - but while opening the file I use sgml application definition with the following settings:
    Default API client:  FmTranslator
    SGML character encoding:  ISO Latin1
    XML character encoding:  UTF-8
    Namespace: Enable
    CSS2 Preferences:
    Generate CSS2: Disable
    Add Fm CSS Attribute To XML: Disable
    Retain Stylesheet Information: Disable
    Entity locations
    Entity search paths
    C:\Program Files\Adobe\FrameMaker9\Structure\sgml\isoents
    So as you can see, character encoding is set to ISO Latin1 (there is no way to use UTF-8 encoding in sgml files)
    Typing ź or ć in sgm document and opening it with framemaker sgml application - I receive: ¿æ and message: "Non-SGML character found; should have been character reference"
    Everything works fine when I type f.ex.: &x016B; and insert appropriate reference lines into isolat1.rw and isolat1.ent files
    But what I would like to avoid is editing those isoent files each time new character is be needed.

  • Unprintable special character in RDP file

    We're having strange issue. We use RDP files generated in RDP client, we then sign those using rdpsign.exe.
    Recently after upgrading our infrastructure from W8/2012 to W8.1/2012R2 we noticed that every RDP file generated in RDC 8.1 client contains a special character on first position that is not visible in normal text editor and is only visible in hex editor.
    This character wasn't there in W8/2012. When I create the RDP file manually (typing (copy/pasting) all the options in a text file), it doesn't contain any special character, but when I later sign that file file rdpsign, it adds that character again.
    How do we get rid of it? It's preventing our provisioning system from substituting username.

    Hello MarkosP,
    Thanks for contacting Microsoft.
    These bytes are regular UTF-16 byte order marks. See here:
    http://en.wikipedia.org/wiki/Byte_order_mark#UTF-16
    If the tool you use on the RDP file does not support UTF-16, you can try to convert the file to ASCII. This will probably work for most RDP files, except if some
    string uses some unicode character not present in the ASCII character set. Here is some info (see the powershell section in the first post/question):
    http://stackoverflow.com/questions/64860/best-way-to-convert-text-files-between-character-sets​
    Best regards,
    Sophia Sun
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Saving webi document from BOXI 3.0 in excel with special character

    Issue :Saving webi document from BOXI 3.0 in excel with special character as report name then file name in excel is not correct.
    This happens only with Mozilla, get correct file name in IE.
    Steps to Reproduce:
    1)Create a simple XI3.0 webi report through mozilla browser
    2)Save the webi report with special character name for e.g øäåýþ.
    3)Open the webi report and save it as excel or pdf file.
    4)Report name øäåýþ saved, displays with other junk characters instead of actual reporta name( øäåýþ)
    5)When saving the save report through IE browser in excel or PDF  display correct report name øäåýþ in excel and PDf file.
    Even after making changes in character encoding to UTF in the Firefox options (Content tab-> font & colors : advanced button -> Character encoding does not make any  difference.
    Has anyone came across such type of issue?
    Whether this is limitation of Firefox or bug.
    Regards,
    Ketki Fadnavis

    Issue :Saving webi document from BOXI 3.0 in excel with special character as report name then file name in excel is not correct.
    This happens only with Mozilla, get correct file name in IE.
    Steps to Reproduce:
    1)Create a simple XI3.0 webi report through mozilla browser
    2)Save the webi report with special character name for e.g øäåýþ.
    3)Open the webi report and save it as excel or pdf file.
    4)Report name øäåýþ saved, displays with other junk characters instead of actual reporta name( øäåýþ)
    5)When saving the save report through IE browser in excel or PDF  display correct report name øäåýþ in excel and PDf file.
    Even after making changes in character encoding to UTF in the Firefox options (Content tab-> font & colors : advanced button -> Character encoding does not make any  difference.
    Has anyone came across such type of issue?
    Whether this is limitation of Firefox or bug.
    Regards,
    Ketki Fadnavis

  • Problem in dealing with special-character filename

    Hi,
    I am facing a weird problem while dealing with a file which has a special character in its name. That character is the big-hyphen, i.e. '–' (not the normal hyphen we can type from keyboard), you would have seen this character in MS Word.
    My java program is running on HP-UX OS, and its basically trying to copy this file to a Windows target system through socket. But while executing it, I am getting Broken Pipe Exception.
    I am applying UTF-8 encoding while running my program (by specifying the argument "-Dfile.encoding=UTF-8" in the java process), and I am also confirming that the file-encoding is being applied to UTF-8 properly by putting a debug in the beginning of the program. My understanding is UTF-8 supports all the characters exist in this world.
    Any suggestion / pointers would be really appreciated.
    Thanks,
    Rajiv

    Fine..... but is there any way to know which encoding has been applied on it ..
    Let's say if you create any file on unix-based system in any application, which encoding gets applied there by default ?
    This file is basically nothing but an html page created using 'Save As' from the browser.
    The person who has created the file is a non-technical .. and won't know much about this all stuff... encoding etc.

  • Special character showing as upside down question mark on oracle report

    We have an oracle report which selects data from a database table. Report shows a name field and names with a special character is showing as upside down question mark.
    The name is Simon John ễễ BaileyŠğčẫ
    But when we run the oracle report the name is showed with 6 upside down question marks
    I am not sure if these characters are unicode? (beyond western european character set)
    Oracle database: 11.2.0.1 with nls_characterset = AL32UTF8
    Oracle Reports Server: 10.1.2.3.0 with the following locale settings:
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    Any ideas, suggesstions, is this font related issue?
    Thanks for your help.

    You mean the operating system where the Oracle reports server resides?

  • External Table - Issues With Special Character.

    I have an external table that reads from a fixed length file. The file is expected to contain special characters. In my case the word containing special character is "Göteborg". Because "ö" is a special character, looks like Oracle is considering it as 2 bytes. That causes the trouble. The subsequent fields in the files get shifted by 1 byte thereby messing up the data. Has anyone faced the issue before. So far we have tried the following solution:
    Changed the value of NLS_LANG to AMERICAN_AMERICA.WE8ISO8859P1
    Tried Setting the Database Character set to UTF-8
    Tried changing the NLS_LENGTH_SYMMANTIC to CHAR instead of BYTE using ALTER SYSTEM
    Tried changing the External table characterset to: AL32UTF8
    Tried changing the External table characterset to: UTF-8
    Nothing works. Other details include:
    • File is UTF-8 encoded
    • Operating System : RHEL
    • Database: Oracle 11gR2
    Any thing else that I might be missing? Any help will be appreciated. Thanks in advance!
    Ganesh

    CREATE TABLE "APP_XXX_XX_XXXX"(
    "KEY_NO" NUMBER,
    "XXX_XXX_XXXXX" VARCHAR2(1 CHAR),
    "XXX_XXX_XXXXX" NUMBER(9,0),
    "XXX_XXX_XXXXX" NUMBER(4,0),
    "XXX_XXX_XXXXX" NUMBER(2,0),
    "XXX_XXX_XXXXX" NUMBER(3,0))
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY "DIR"
    ACCESS PARAMETERS
    ( RECORDS DELIMITED BY NEWLINE
    CHARACTERSET 'UTF8'
    LOGFILE APP_XXX_XX_XXXX_%A_%P.LOG'
    BADFILE 'APP_XXX_XX_XXXX_%A_%P.BAD'
    DISCARDFILE 'APP_XXX_XX_XXXX_%A_%P.DSC'
    FIELDS(
    KEY_NO POSITION(1:9) INTEGER EXTERNAL,
    XXX_XXX_XXXXX POSITION(10:10) CHAR,
    XXX_XXX_XXXXX POSITION(11:19) INTEGER EXTERNAL,
    XXX_XXX_XXXXX POSITION(11:14) INTEGER EXTERNAL,
    XXX_XXX_XXXXX POSITION(15:16) INTEGER EXTERNAL,
    XXX_XXX_XXXXX POSITION(17:19) INTEGER EXTERNAL)
    LOCATION
    ( 'FILE1.TXT')
    REJECT LIMIT UNLIMITED
    PARALLEL 4;
    The data forms part of a major driver table, which I may not be able to provide as per the NDA with my company.
    The Script I have shared is standard template for creating external table as part of our applications.
    We majorly cater for EU regions with this project.(European Characterset needed to be supported)
    Thanks
    Ganesh
    Edited by: RGRAM on Feb 11, 2011 12:44 PM

  • Load special character £ in node name

    Hi,
    I am importing the hierarchies with special character £ and once imported it shows as following before the node name:
    small square box in place of £ with UTF8 as character encoding while importing and
    ? mark in place of £ with ASCII or ANSI as character encoding while importing.
    Please let me know how to get the £ in the node name.
    Thanks,
    Ravi

    Got it,
    Save the text file itself in UTF format and then import with UTF8 encoding in DRM.
    Thanks,
    Ravi

  • Special character occuring in email while sending mail

    this is part of my code for sending email:
    utl_smtp.open_data(l_conn);
    utl_smtp.write_data(l_conn, l_header);
    l_encoded_subject := REPLACE(utl_raw.cast_to_varchar2(utl_encode.quoted_printable_encode(utl_raw.cast_to_raw(l_subject))),'=' || CHR(13) || CHR(10), '');
    utl_smtp.write_data(l_conn, 'Subject: =?UTF-8?Q?' || l_encoded_subject ||'?=' || utl_tcp.crlf);
    utl_smtp.write_data(l_conn, 'MIME-version: 1.0' || utl_tcp.crlf);
    utl_smtp.write_data(l_conn, 'Content-Type: text/html; charset=utf-8' || utl_tcp.crlf);
    utl_smtp.write_data(l_conn, 'Content-Transfer-Encoding: 8bit' || utl_tcp.crlf);
    utl_smtp.write_raw_data(l_conn, utl_raw.cast_to_raw(utl_tcp.crlf || l_email_body || utl_tcp.crlf));
    its working fine BUT....
    email_body contains '&lang' .....
    and when email is sent to lotus notes, it gets converted to some special character whereas its coming fine when i send to gmail..
    please help me fix this...

    sounds like Lotus parsing the html differently, can you try the solution mentioned in here:
    http://bytes.com/topic/javascript/answers/91323-opera-turning-my-lang-into

  • UDF for Special Character Conversion

    Hello All,
    Can any one help me with the UDF for special character conversion code.
    I mean if a special character is given it should pass a blankspace.
    << Moderator message - Everyone's problem is important >>
    Many thanks,
    Rahul.
    Edited by: Rob Burbank on Oct 29, 2010 4:32 PM

    Hi Rahul ,
    the best way to deal with special character is to use proper encoding in your Sender Communication channel it self .So that in your payload you will get proper value .
    IF you are getting some special character which is not covered in encoding UTF-8 thne you can use encoding IS0-8859-1 .You can easily refer in help that how to use encoding in your communication channel .
    Regards,
    Saurabh

  • Send special character by mail

    We are creating an XML spreadsheet that is sent by mail, and we are requested to show in a cell the special character Delta (u0394).
    The overview of the process is the following:
    - We create an XML file through IF_IXML interface, with enconding UTF-8 Little Endian.
    - Then we render XML into an internal table.
    - At last, we send the XML spreadsheet (the internal table) as an attached file by mail through SO_NEW_DOCUMENT_ATT_SEND_API1.
    The problem we are facing is the following:
    If we try to put Delta (u0394) as a character in a data tag (it's a variable of type String), SAP is turning it as '#', and not showing the character.
      DATA: o_cell TYPE REF TO if_ixml_element,
            o_data TYPE REF TO if_ixml_element,
            v_string TYPE string.
    * Crea una celda
      o_cell = o_xmldoc->create_simple_element( name = 'Cell'
                                                 parent = o_row ).
    v_string = 'u0394'.
    *   Crea un dato
        o_data = o_xmldoc->create_simple_element( name   = 'Data'
                                                   parent = o_cell
                                                   value  = v_string ).
    When you open the file in Excel, the '#' character is shown instead of  'u0394'.
    How can I show that Delta character (u0394) in the XML spreadsheet file I am sending?
    Please tell me if more information is needed.
    Thanks in advance,
    Martin

    I tried like you said:
      DATA: o_cell TYPE REF TO if_ixml_element,
            o_data TYPE REF TO if_ixml_element,
            v_string TYPE string.
    * Crea una celda
      o_cell = o_xmldoc->create_simple_element( name = 'Cell'
                                                 parent = o_row ).
    v_string = '& #916;'.                                           'Added a space in the middle to show the HTML entity code in the forum
                                                   parent = o_cell
                                                   value  = v_string ).
    But SAP is tranforming my XML text to:
    <Cell>&amp;#916;<Cell>
    ( &amp; is the HTML entity for '&')
    How can I put Delta character so that SAP turns it in the right HTML entity &#916;
    Or how can I manage so that the cell value generated is:
    <Cell>&#916;<Cell>

  • Can i send cloab data from UTL SMTP WRITE RAW DATA?

    hi
    here is my code to send email from oracle as attachment using demomail package provided by oracle----
    create or replace procedure html_mail(
    p_sender varchar2, -- sender, example: 'Me <[email protected]>'
    p_recipients varchar2, -- recipients, example: 'Someone <[email protected]>'
    p_subject varchar2, -- subject
    p_text varchar2, -- text
    p_filename varchar2, -- name of html file
    p_blob blob -- html file
    ) is
    conn utl_smtp.connection;
    i number;
    len number;
    BEGIN
    conn := demo_mail.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => demo_mail.MULTIPART_MIME_TYPE);
    demo_mail.begin_attachment(
    conn => conn,
    mime_type => 'application/csv',
    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 + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(p_blob, demo_mail.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 + demo_mail.MAX_BASE64_LINE_WIDTH;
    END LOOP;
    demo_mail.end_attachment(conn => conn);
    demo_mail.attach_text(
    conn => conn,
    data => p_text,
    mime_type => 'text/csv');
    demo_mail.end_mail( conn => conn );
    END;
    Above i m using
    p_blob blob -----to send message as attachment now i have table containg data into clob format nw if i send it as it is just changing coulmn from Pblob--- Clob
    then it gives me error at UTL SMTP WRITE RAW DATA...
    for that i do wrkaround as i m taking data from table as clob convert it to blob and
    send as attachment ...
    can any one guide me little that is this approcah proper?do i really need to convert data from clob to blob?
    bcause in 10g Mail UTL_MAIL raw attachment i have limitation on size of email.attachment........

    > still no email comes. No error as well.
    SMTP itself is straight forward. It is a delivery protocol. And very easy to implement. Which is what UTL_SMTP does - without bugs or errors (none to my knowledge and experience using UTL_SMTP extensively for a long time now).
    The problems experience are 50% of the time, incorrectly using SMTP. The other 50% of the time, incorrectly constructing a Mime Internet Message Body for SMTP to deliver. Both are issues that the caller (app code using UTL_SMTP) needs to address.
    As UTL_SMTP is program-driven, it is not that easy to play with and debug the conversation with the SMTP server - and figure out just what the SMTP server expects, not like, disallows, etc.
    In order to make sure that you are having a proper/valid conversation with the SMTP server, do it interactively using a telnet session on the Oracle server platform. All you do with telnet is to send the very same PL/SQL coded SMTP commands and parameters to the SMTP server - but interactively.
    E.g.
    /home/billy> telnet mail 25
    Trying 165.143.128.194...
    Connected to mail
    Escape character is '^]'.
    220 mail Tue, 13 May 2008 11:20:59 +0200
    HELO 10.251.93.58
    250 mail: Hello [10.251.93.58]
    MAIL FROM:<[email protected]>
    250 <[email protected]>: Sender Ok
    RCPT TO:<[email protected]>
    250 <[email protected]>: Recipient Ok
    DATA
    354 mail: Send data now. Terminate with "."
    Subject: Test Message
    This is a test e-mail.
    250 mail: Message accepted for delivery
    QUIT
    221 mail closing connection. Goodbye!
    Connection closed by foreign host.
    /home/billy>
    Simply substitute the SMTP parameters you use in your PL/SQL calls to UTL_SMTP above. And use the same SMTP command sequence as you do in your code.
    Note that in the above case, the SMTP server quite happily accepted incorrect and undeliverable sender and recipient addresses. Which means that the e-mail will wind up in the Big Bit Bucket In The Sky. No errors.

Maybe you are looking for