Problem with Demo_Mail package sending an attachment and special characters

Hello

I did use the Demo_Mail package with the example in the http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html for many years on my 9i database.

Recently, we have taken a form that depends on this package and quickly found that Asian characters were not correctly in the e-mail subject or body. When I changed the procedure by example, characters came through, however, attachments now appear in the body of the email as ascii.

/*------------------------------------------------------start the email creation--------------------------------------------------------------------*/
Conn: = demo_mail.begin_mail)
sender = > from_name,.
recipient = > to_name,.
subject = > subject,.
mime_type = > "text/plain; charset = utf8');

() demo_mail.write_mb_text
Conn = > conn,.
message = > message | UTL_TCP. CRLF);

If file1 is not null
then
() demo_mail2.begin_attachment
Conn = > conn,.
mime_type = > ' application/octet-stream. "
Online = > FALSE,
v_filename = > file1.
transfer_enc = > 'base64');

file_len: = dbms_lob.getlength (wire);
modulo: = mod (file_len, TN);
parts: = trunc(file_len / amt);


/ * (dbms_lob.read (wire, amt, filepos, buf); * /)


While (counter < = pieces) LOOP

DBMS_LOB. Read (wire, amt, filepos, buf);
demo_mail.write_raw (conn, utl_encode.base64_encode (buf));
filepos: = counter * TN + 1;
counter: = counter + 1;

END LOOP;

/ * Point on the rest of the data buffer * /.
IF (modulo <>0) then
DBMS_LOB. Read (wire, modulo, filepos, buf);
demo_mail2.write_raw (conn, utl_encode.base64_encode (buf));
end if;

() demo_mail.end_attachment
Conn = > conn);
end if;

() demo_mail.end_mail
Conn = > conn);
/*------------------------------------------------------end the email creation--------------------------------------------------------------------*/


How can I have my cake and eat it too? Examples of scripts showing this scenario exist?

In addition, even if I was able to get the body of the email to display special characters, the subject line still displays question marks instead of the special characters. I was never able to solve this problem.

Any help to any of these questions is greatly appreciated!

Thank you

Kim

You use the utl_encode.quoted_printable_encode before making all these changes? Most, if not all, of these accented characters must be converted to quoted printable form by the utl_encode.quoted_printable_encode function, then you only need to focus on the specific characters that must be encoded to the channel to cover additional expenditures for the mimeheader encoding. Specifically the white space characters should be encoded as well as the question mark.

Also, I have done some minor testing and it seems that the quoted_printable_encode function folds the text when it exceeds a specific length. If I unfold the coded text object lines seem to come by fine. The folding text string is an equal sign followed by the sequence CRLF, unfold the text is a simple matter of these three characters. These changes becomes the encoding routine encapsulated in a function:

create or replace function mimeheader_encode(
      p_str varchar2
    , p_charset varchar2 := 'UTF-8') return varchar2 is
  l_str varchar2(2000);
begin
  l_str:=utl_raw.cast_to_varchar2(utl_encode.quoted_printable_encode(utl_raw.cast_to_raw(p_str)));
  l_str:=replace(l_str,'='||chr(13)||chr(10),''); --unfold the data
  l_str:=replace(l_str,'?','=3f'); --quote question marks
  l_str:=replace(l_str,' ','=20'); --quote spaces
  l_str:='=?'||p_charset||'?Q?'||l_str||'?='; -- add prefix and suffix
  return l_str;
end;
/

Tags: Database

Similar Questions

  • Problem with subscription package of photographers (lightroom and photoshop)

    Hi all, I have a problem with lightroom and photoshop (photographers package subscription), I downloaded both of them creative clouds and when I open it says them that I have a trial version for 30 days do you know how I can fix this problem? Thank you!!!

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    .

    If Yes

    Some general information for a subscription of cloud

    Cloud programs don't use serial... numbers you, connect you to your cloud account paying to download & install & activate... you may need to sign out of the cloud and restart your computer and log into the cloud for things to work

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    .

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • HP 15-d005TU Notebook PC: problems with the top case on my keyboard special characters.

    The special uppercase are all mixed for example when I press on "I get @ and vice versa and so also with many others."

    HP technical support tried to helpout superimposed thses since a few months and I have also tried to follow what is indicated in this forum. No luck so far. If anyone can help.

    Hello

    Looks like you got the wrong keyboard layout set - ie US layout on a UK keyboard, or vice versa.

    You can change your keyboard layout as described on the corresponding link below.

    Change of keyboard - Windows 10

    Kind regards

    DP - K

  • my computer will not install itunes 10.5, it tells me "Setup has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2330.

    original title: Itunes problem

    my computer will not install itunes 10.5, it tells me "Setup has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2330. "What should I do?

    Contact the manufacturer (Apple) of the application (iTunes) you are having problems with.

    Uninstall all previous versions, try to download (re-record not running) and then do a right click on it and RUN AS ADMINISTRATOR.

    (Vista 32-bit or 64-bit)?

  • Not able to install Itunes for my pc windows7 (64 bit) im... Every time I have install I get the message "there is a PROBLEM WITH CE PACKAGE WINDOWS INSTALLER. A DLL REQUIRED FOR THIS FULL INSTALLATION COULD NOT BE EXECUTED. PLEASE CONTACT THE SUPPORT STA

    Not able to install Itunes for my pc windows7 (64 bit) im... Every time I have install I get the message "there is a PROBLEM WITH CE PACKAGE WINDOWS INSTALLER. A DLL REQUIRED FOR THIS FULL INSTALLATION COULD NOT BE EXECUTED. PLEASE CONTACT THE SUPPORT STAFF. "What should I do? I am new to Iphone! If you could help me on this, it would be very appreciated...

    aarruunn, you might want to try Windows Installer Cleanup utility.

    http://www.MajorGeeks.com/files/details/windows_installer_cleanup_utility.html

  • Diagnostics Windows network, the error reads 'Problem with wireless adapter or access point' and fails to solve the problem.

    «Problem with access point or wireless adapter»

    Hi, I just bought a new laptop & I have the extreme difficulty to stay connected to the internet. When I run Windows Network Diagnostics, error reads 'Problem with wireless adapter or access point' and fails to solve the problem. Help, please... Thank you, Maria

    HI Maria,

    ·         What operating system is installed on your computer?

    ·         You have installed the latest drivers for wireless network card?

    Follow the suggestions below for a possible solution:

    Method 1: Start your computer in a clean boot state in order to check if the applications of third parties or startup items is the origin of the problem.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

     

    Note: After troubleshooting, make sure that you configure the computer to start as usual as mentioned in step 7 in the above article.

    Method 2: See these articles for solve wireless problems:

    Why can't I connect to the Internet?

    http://Windows.Microsoft.com/en-us/Windows7/why-can-t-I-connect-to-the-Internet

     

    How can I troubleshoot network card?

    http://Windows.Microsoft.com/en-us/Windows7/fix-network-adapter-problems

     

    Windows wireless and wired network connection problems

    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

    Let us know if that helps.

  • I have a problem with the drag (cursor snap) video and audio stuttering!

    I have an emachine windows vista home edition and have caused problems with the drag (cursor snap) video and audio stuttering.  my hardware configuration includes an HP printer and a video camera from Microsoft with pregnant beyond the keyboard, monitor, and system speakers routine.  Are there updates or the settings that I can apply to correct this problem?

    http://www.eMachines.com/support/drivers.html

    The latest drivers/software for your machine come directly from eMachines.

    Click the link above for them.

    See you soon.

    Mick Murphy - Microsoft partner

  • Is anyone else having problems with Windows 8 when your typing and e-mail? For some reason, it comes out constantly to the tile screen while I type making me about starting more.

    Is anyone else having problems with Windows 8 when your typing and e-mail? For some reason, it comes out constantly to the tile screen while I type making me about starting more.

    Hi Chaz,

    I thank you for your message and gives us a chance to help you. I see that the Mail app closes while you are typing an email.

    Please answer these questions to get a better understanding of the issue.
    1 have changes made to your computer before this problem?
    2 shut down other applications while they are in use?
    3. do you get an error code?

    You can try these methods to check whether the problem is resolved.

    Method 1: Run the troubleshooter of app.

    http://download.Microsoft.com/download/F/2/4/F24D0C03-4181-4E5B-A23B-5C3A6B5974E3/apps.diagcab

    Open this link to launch the troubleshooter.

    Method 2: Update the application.

    Method 3: Reinstall the application.

    This link has the steps that you can follow to update and reinstall the application.

    http://Windows.Microsoft.com/en-us/Windows-8/what-troubleshoot-problems-app

    Feel free to use the forum for any other issue of Windows, you may have.

  • I have a problem with synchronize them between (summary) video and slides in IPADs, HTML5. Please, help me!

    I have a problem with synchronize them between (summary) video and slides in IPADs, HTML5. Please, help me!

    I have an idea, I think that what's happening is the fact that the video is not charged, it cannot find the video, he goes to the last downloaded part.

  • Problems with the installation of the bridge and the company

    Hello world!
    I have problems with the installation of the bridge and the company. Although I have install both of them successfully, when I try to connect to the gateway through the console I have error message saying there is no company installed. In fact, I get an error as well through the wizard saying "failed to run. Please see details below:

    Unable to launch: "C:\DOCUME~1\SIEBEL~1\LOCALS~1\Temp\2\LRE19.tmp\bin\java.exe-Dtemp.dir=C:\DOCUME~1\SIEBEL~1\LOCALS~1\Temp\2\ - cp C:\siebelent\siebsrvr\bin\setup.jar run - args LANG = ENU VISIBILITY = REPEAT BUSINESS = FALSE MODE = MODEL_FILE=C:\siebelent\siebsrvr\admin\siebel_server_sia.scm LIVE" error code: ""(SBL-STJ-00152)-1 "»

    Also, when I try ot run the following in the console: C:\siebelent\gtwysrvr\BIN\srvrmgr.exe - u - p SADMIN SADMIN - g siebelwin2k32-e SIEBELENT, I get this error: fatal error (3015667): the program variable 1% is not defined, existing...


    Thank you in advance for your help!

    MARIANA

    Mariana,

    Please confirm if you try to configure the siebel server in the same machine as the gateway server. If so try to use localhost instead of the hostname of the machine setting up Siebel server.

    I assume you are using windows 2003 as the operating system.

    Thank you

    Wilson

  • Problem with cfhtmltopdf and special characters

    How can I fix cfhtmltopdf showing '? ' for special characters "1/2", "3/4", "•"? We have 11,0,07,296330 Standard in ColdFusion Server installed.

    After further research and discussed with our system/DBA administrator, we suspected that he needed the CF11 Server JVM setting. We have added '-Dfile.encoding = utf8 "to java.args in ShadoMX/util/Flex/SDK/bin/jvm.config and special characters displayed correctly.

  • Remove the spaces and special characters to a form field

    Hello

    I am tragically new to all this, but I'm trying to create a form in Adobe Acrobat 9.  I am trying to use a custom script Format to make entries in a form field and automatically remove the spaces and special characters (hyphens specifically).  For example, if a user 'RAN - 99 06' entries I want to change it to "RAN9906."  I found this script that does not allow users to input special characters

    If (! event.willCommit) {}


    Event.change = event.change.replace (/ [------$# ~ %------*------*------^-------------(\)------+=------[\]------{\}; \ "\ <>\ \?"]) \ | \\\ !] /g, "");

    }

    And it's OK, but I can't understand how to prohibit the spaces.  In addition, the perference would be a script to allow users to enter data as they wish, but to clean after leaving the text field.

    Thanks in advance!

    Yes, there are a few changes during the passage of the code of the event in the sequence of keys to the Validate event.

    First of all, you need not try the willCommit. In fact, when the sequence of events of field reached the Validate event, the field is already committed. The Validate event does not therefore the property of willCommit.

    Secondly, in the Validate event, you work on the event.value and either event.change. Thus, you will replace accordingly.

    And who should actually do.

    I hope this can help.

    Max Wyss.

  • Problem with the Package Windows Installer... when trying to install ITUNES 9.2 and Quicktime.

    I bought an IPHONE 4 yesterday.  For more than 7 hours, I tried everything to download ITUNES 9.2.  I get the same error.  I spoke with apple as Microsoft.  I didn't PAY to get assistance from Microsoft yet and I hope I don't have to.

    Error: problem with the Windows Installer Package.  A program required for this install to complete could not be run.  Contact your provider to support personal or package.

    I have Windows XP.  I uninstalled and re-installed Safari and which did not help (at one point, I had problems with Safari).  I also have at one point received an alert on 'applesync.notifier' could not be executed.

    I have no idea where from here, but I'm frustrated.  I want to use my phone for something more than "just a phone" and I can't.  I have to carry my OLD Iphone (1st generation original).  Help<><>

    There is a simple way to do it!

    I had this problem too, but I did

    first open Installer u then let it install

    When you get the messege, click ok and it will say restoration of action but don't get put off by this cause after 5 min, it will say: it is installed and restart your computer

    hope this has helped

  • Problem with windows mail send not of pictures and attachments? Help, please!

    Hello, yesterday I continued to get an error code when you try to update some security updates, I've used the tutorial help and went and deleted some file deep into my system, as he ordered.  He has not yet fixed the error and now my windows mail will not send attachments and the police to the address info seem different?  I'm lost, please help!

    Hi Pishy,

    1. what was the error code that you received when you try updates security?

    2. what tutorial did you delete files?

    3. what happens when you try to send emails with attachments? You receive messages or error codes?

    You can try to perform a restore of the system to a prior restore point you have been affected by the issue.

    Note: When you perform the system restore to restore the computer to a previous state, programs and updates that you have installed are removed.

    To run the system restore, you can consult the following link:

    System restore

    System Restore: frequently asked questions

    For more information, you can also consult the following article:

    Solve problems with Windows Mail

    Hope this information is useful.

  • Problem with windows mail. sending attachments.

    When I send an attachment (stored in a file. jpg) photo with Windows Mail (Windows Vista) the recipient cannot open the attachment... it says .eml file.  Can anyone help?   I send things resized smaller format, is not the size that problem, and it IS saved in the appropriate file type.  The recipient uses Windows 7.  Any suggestions for me or for my friend with Windows 7 to solve our problem?  Thank you!


    When I send an attachment (stored in a file. jpg) photo with Windows Mail (Windows Vista) the recipient cannot open the attachment... it says .eml file.  Can anyone help?   I send things resized smaller format, is not the size that problem, and it IS saved in the appropriate file type.  The recipient uses Windows 7.  Any suggestions for me or for my friend with Windows 7 to solve our problem?  Thank you!


    I've never bothered to use 'resize' option send pictures, and I always use my Windows Mail/Windows Live Mail Attach option. That said, the issue of your...
    Maybe you want to retrace your steps to attach the photo.
    What follows is my step by step:
    Select the picture in my pictures in jpg format folder > toolbar above, email > window size photo, select the size, click on attach.
    That's all. Photo attached.
    You do it like that?

    t-4-2

Maybe you are looking for

  • MMC.exe cannot be run in dos mode

    When I try to open mmc.exe it open notepade text file, I can not open Task Manager or administration tools or any thing has a relationship with microsoft management consle Pls help

  • I use Outlook express. Telephone support to the Mirosoft says I have a corrupted Inbox. Can you help me?

    I phone supports microsoft says I have a corrupted Outlook Express Inbox. I use Windows XP Home Edition in option 2. Can you help me solve this problem?

  • ATC-705-uc52 video card update

    I have an ATC-705-uc52.  I need 3 monitors to work. I have a Geforce GT520 PCIe x 16 7200LE which worked fine with my old machine, but when I put it in this one, the monitor does not come on either built into the video card (which I suppose is disabl

  • Re: Looking for Feedback

    I'm actually trying to figure out how I can find the email for my eprinting between my HP Officejet Pro 8600 and my Android II. I downloaded the eprint through market software on my android and I checked everything on the menu on my printer for the e

  • RealTek ALC-3234

    Hello. Last week, I bought a Dell OptiPlex 3020 Micro desktop running Win8. There is no sound when starting. I go into the BIOS & Audio enable is checked. I uncheck it, tick it again once, apply & reboot. Can I make it sound. If I restart again I sti