Email attachments not showing as attachments

Hi,
i'm using the following code to attach a pdf blob to an email
CREATE OR REPLACE PROCEDURE sendPDFBLOB (lv_server varchar2, lv_from varchar2, lv_rcpt varchar2, lv_cc varchar2,lv_bcc varchar2, lv_subject varchar2
,  lv_message varchar2, i_blob blob) IS
  l_conn UTL_SMTP.CONNECTION;
  l_len number :=0 ;
  l_idx integer := 1;
  l_buff_size integer := 57;
  l_boundary varchar2(32) := sys_guid();
  l_raw raw(57);
  l_blob blob := to_blob('1');
  l_attachment_name varchar2(100);
BEGIN
-- Connect
       l_conn := utl_smtp.open_connection(lv_server);
       utl_smtp.helo( l_conn, lv_server);
       utl_smtp.mail( l_conn, lv_from );
       utl_smtp.rcpt( l_conn, lv_rcpt );
       utl_smtp.open_data(l_conn);
       -- Header
       utl_smtp.write_data( l_conn, 'From: ' || lv_from || utl_tcp.crlf );
       utl_smtp.write_data( l_conn, 'To: ' || lv_rcpt || utl_tcp.crlf );
       utl_smtp.write_data( l_conn, 'Subject: ' || lv_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: multipart/mixed' ||  utl_tcp.crlf );
       utl_smtp.write_data( l_conn, ' boundary= "' || l_boundary || '"' || utl_tcp.crlf );
       utl_smtp.write_data( l_conn, utl_tcp.crlf );
       -- Body
       utl_smtp.write_data( l_conn, '--' || l_boundary || utl_tcp.crlf );
      utl_smtp.write_data( l_conn, 'Content-Type: text/html;US-ASCII' || UTL_TCP.CRLF);
      utl_smtp.write_data( l_conn, utl_tcp.crlf );
       utl_smtp.write_data( l_conn, utl_tcp.crlf );
   --SEND PDF BLOB
    l_attachment_name := 'invoice.pdf';
     utl_smtp.write_data( l_conn, '--' || l_boundary || utl_tcp.crlf );
     utl_smtp.write_data( l_conn, 'Content-Type: text/plain;US-ASCII; name="' || l_attachment_name || '"' || utl_tcp.crlf );
     utl_smtp.write_data( l_conn, 'Content-Disposition: attachment; filename="' || l_attachment_name || '"' || utl_tcp.crlf );
     utl_smtp.write_data( l_conn, 'Content-Transfer-Encoding: base64' || utl_tcp.crlf );
     utl_smtp.write_data( l_conn, utl_tcp.crlf );
       -- Loop through the blob chuck it up into 57-byte pieces and base64 encode it and write it into the mail buffer
    l_idx := 1;
        l_len := dbms_lob.getlength(i_blob);
        while l_idx < l_len loop
           dbms_lob.read( i_blob, l_buff_size, l_idx, l_raw );
           utl_smtp.write_raw_data( l_conn, utl_encode.base64_encode(l_raw) );
        utl_smtp.write_data( l_conn, utl_tcp.crlf );
           l_idx := l_idx + l_buff_size;
        end loop;
        utl_smtp.write_data( l_conn, utl_tcp.crlf );
    -- Close Email
     utl_smtp.write_data( l_conn, '--' || l_boundary || '--' || utl_tcp.crlf );
     utl_smtp.write_data( l_conn, utl_tcp.crlf || '.' || utl_tcp.crlf );
     utl_smtp.close_data( l_conn );
     utl_smtp.quit( l_conn );
     exception
       -- smtp errors, close connection and reraise
       when utl_smtp.transient_error or
            utl_smtp.permanent_error then
         utl_smtp.quit( l_conn );
         raise; 
END;This is working, but the problem that i have is that the attachment differs depending on the mail client.
Using thunderbird i can see in the header of the mail that there is an attachment and when opening the message i can see the attached file, but when i send this to an gmail account the header doesn't show an attachment and the body of the mail contains a file 'noname'.
If i send multple attachments these are viewed correctly from thunderbird but the gmail account tends to show them as one 'noname' file which is the whole block of the email.
Teo

This is not a database issue, but probably more a question of correct MIME format.
I suggest in your gmail account to try to click "Show original" - that will show you the exact content of the MIME you are sending.
Verify that the MIME email is correctly built - it could be that Thunderbird is more "forgiving" and does not mind a little error.
If that does not find the issue, I suggest trying a forum of MIME/SMTP experts, not database experts ;-)

Similar Messages

  • Attachments not showing as attachments in mail

    Why are my attachments not showing up as attachments when recieved. They are sent from Mail as windows "friendly" - but never the less always show up inlaid in the mail. The recipient then have to ctrl clik on the documents, save them on the harddrive before being able to fx print.
    very annoying indeed - please can anyone help on this :-)

    thanks for quick responce - but the problem lies with the recievers of MY mails - where the attachments is only inlaid and not showing as an attachment. The reciever then have problems opening attachments in i.e. Photoshop, and they cannot print the attachments directly from the mail..

  • Since updating to 6.1.2 emails are not showing attachments?

    I have received numerous emails that are not showing PDF attachments. When checked on a PC they are there.
    Any suggestions ?

    Try turning your phone off, wait a minute or so, then turn it back on.

  • TS3899 the text of my incoming emails is not showing on the screen.  I must have pushed some setting change but I can't figure it out.  Thanks...M

    the text of my incoming emails is not showing when I tap the message.  I probably changed some setting by mistake but I don't know what i did.  would like to be able to read my emails on the screen.  the 2 line starting area shows fine.

    browsing around internet found others have had this problem and recommended turn off/turn on phone, which I did, and that fixed it.   at least for now.   thanks...

  • TS3276 After updating software yesterday, noticed that sent emails are not showing up in Sent Folder for one of my accounts.

    After updating software yesterday, noticed that sent emails are not showing up in Sent Folder?

    Are you storing Drafts, Sent, Trash and Junk messages on the server via your .Mac account with Mail?
    If so, do you access your .Mac account with an email client on another computer or regularly access your account via webmail on another computer?
    If not, any other reason you need to store Drafts and Sent messages on the server?
    While composing a message with Mail, it is temporarily saved in the account's Drafts mailbox so sounds like something went wrong with the process between finishing and sending the message with Drafts and Sent being stored on the server.
    If you don't have any need for this, better to store Drafts and Sent messages locally on the hard drive with Mail.

  • Why my old emails are not showing on the blackberry

    Hi Guys,
    I have just bought Blackberry Curve 9360. Can somebody, please tell that why my old emails are not showing on the blackberry. May be it has not synchronized my whole mailbox.
    Kindly advise how can I do that.
    Regards... Murtaza

    Old emails, in what manner? As in previous to installing the account on this device?
    Did you use the Device Switch Wizard found in the BlackBerry Desktop Software?
    How did you move your old emails over from the old device to the new?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Make the emails do not show in the ipad or iPhone after i read them in my macbook air

    make the emails do not show in the ipad or iPhone after i read them in my macbook air

    Assuming you're using Apple's Mail on your Mac, go to your Mac's mail Preferences (from Mail on the menu bar).
    Click Accounts on top, then click your email account on the left.
    Then click Advanced on the top.
    Check "remove copy from server after retrieving a message" and set the line below it to "immediately".
    That will do it.

  • I really need help on reseting my security questions i tried sending in my rescue email but the rescue email is not showing up on the password and security tab and i'm positive i don't know the answers this is really getting annoying _

    i really need help on reseting my security questions i tried sending in my rescue email but the rescue email is not showing up on the password and security tab and i'm positive i don't know the answers this is really getting annoying

    If your rescue email is not working and you cannot remember even one answer, then you only have one option - call Apple.
    http://support.apple.com/kb/HT5665

  • Emails suddenly not showing up

    I have a BB Curve.  I use gmail.  Suddenly emails are not showing up on my BB.  I have not changed any settings at all.  I have tried rebooting by removing the battery.  Can someone help?

    loy757 wrote:
    By the time I saw your response the problem had resolved itself.  Thank you.
    Excellent!  Good luck.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Email is not showing up - i can see there is text in my "preview", but when I open the email message, there is no text

    My email is not showing up.  I can see that there is text in the preview, but when I open the email, there is "to" and "from" and subject, but no text in the body of the email. ??

    Try resetting your phone: hold the on/off and home buttons until you see the Apple logo (ignore the off slider that appears first), then release.  You won't lose any data by doing this.

  • TS3276 Email does not show contents, only to and from.

    Email does not show contents, only to and from up top.  Just started doing this last week.  Already deleted account and added it again still same problem.

    Mac OS version?

  • Iphone updated to 5.0 - emails are not showing up in notifier

    i can see everything else but my emails are not showing up. i followed the instructions and have my yahoo and gmail coming in as push. anyone esle having this problem? can anyone help? thanks!

    Try turning the account off and on : Settings > Mail, Contacts, Calendars , then tap the account on the right, slide Mail to 'off', exit settings and go back into the Mail app, and then go back to Settings and slide Mail back to 'on'
    If that doesn't work then try closing the Mail app completely : from the home screen (i.e.not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    Also do a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Email sent with attachments not showing in sent folder

    I have recently found that emails I send with an attachment do not show up in my sent folder. They are arriving at recipient but I do not then have a record of the email sent.  This is really very annoying and I can see a few other poplin online forums are having the same problem.  However nobody seems to have come up with a solution.  It appears I have to cc myself in to the mail and then move it to my sent folder when it arrives. I can't keep doing this.  Other emails without attachments are showing in the sent box.  Does anyone have any idea what I can do to fix this please.

    Didn't work for me... (rebuilding the mailbox)
    I cleaned the Sent mailbox and rebuilt the culprit mailbox and the general "Sent" mailbox.... sent a message.. it 'hung' in the Outgoing Message box for @ 20 seconds and it sounded as if it were sent and when checking the Sent mailbox for that account, it did not show.... I tested this again with another message addressed to myself and it sent as expected and showed in the Sent mailbox for the account... Did another test to a different recipient and the message sent as expected and showed in the Sent mailbox... The only corrollary that exists at this stage, is the recipient of the "disappearing" messages is that I email this particular recipient very regularly and at times with long threads... However, these last messages were completely different subjects and previous replies to this persons email sent as expected.... so this is a random occurrence.
    --prd54usa

  • Attachments not showing when email message printed

    I recently sent an e-mail with 11 attachments. When I printed that e-mail message, it did not show the 11 attachments in the body of message as has previously. Any suggestions?

    Fixed it on my machine!  Found the solution via an similar problem people were having in the Aperature program.
    SEE HERE:
    http://aperture.maccreate.com/2011/08/25/aperture-3-will-not-play-videos-if-lion -is-installed-and-3ivx-video-codec-is-installed/
    I did a spotlight search for 3ivx on my computer and it found an 3ivx UNINSTALLER.
    After uninstalling 3ivx and restarting - MOV VIDEO files worked again in my Apple Mail client. 
    I wasted 2 weekends of clean installs etc etc.  Glad it's ficed though.  

  • Slideshow 1.4.7 won't work in TB 24.4.0, does not show beside attachments, any idea's

    Running w8.0 just installed Slideshow 1.4.7 to view multiple jpg images in an attachment in Thunderbird 24.4.0. As I understand it Slideshow should show beside the attachments, it's not there. Have tried numerous reboots etc but still not happening. An ideas?

    Hi Matt, Yes I have expanded the attachments (there are 15 in this particular email) & there is nothing other than the jpg images. Slideshow is in the "Extensions" and appears to be ready to go, just not showing up in attachments.

Maybe you are looking for

  • Translucent menu bar is static, or not truly transparent (not live)

    You can make the menu bar translucent, under: System Preferences / Desktop and Screen Saver, using the check box at the bottom of the Desktop pane. If you do that while you're using a checkered or patterned desktop background (or wallpaper) image the

  • Problems with PDF report generation on WEB application

    Hi friends. I have the following problem. I heve many reports running on a client/server system. But we decide to move one by one, the menu options of the system to the WEB, using iAS. Most of the reports works just fine, but some of them works wrong

  • Sync Music and Podcasts from two computers

    I would like to use my home Mac Pro to sync my iTunes music library and my PowerBook to sync podcasts (because I travel quite alot) to my iPhone is this possible? Thanks for any suggestions Mike

  • MacBookPro C2D - poor overall quality

    I have a MacBookPro 15" C2D and I am very dissapointed by the overall quality. I had to turn it in the 2nd time. Problems that occured: strange high frequency sound, hard drive making wired noise. Left USB port not working, when closing the MacBook t

  • Process flow run success but underline mapping sql still running

    We have mapping A and B in process flow. We configured Enumerated Condition (success) in mapping A to kick off mapping B after A is success. But the underline SQL in A took long time to finish therefore mapping B starts before data loading is finishe