Kmail doesn't correctly redirect html messages

Hey everyone,
I would like to redirect an HTML message that comes into my KMail as a MIME email.  In KMail, the original message has two body parts in the bottom pane, one Plain Text and one HTML.  However, when I redirect the message, it puts the Plain Text part as the body part and makes the HTML part an attachment.  Is there a way to perfectly maintain the HTML message when redirecting?  Thanks!

Sorry if I wasn't clear... the navigation works correctly; I get to the page I'm tyring to get to.  One of the things that page should do is display an image, the I use a URL parameter to build the image file name to retrieve.  The link in the first page is something like <a href="gallery.php?pg=1">.  Works fine if the first page (the one I'm navigating from) is a PHP page, doesn't work (with the same code which is only HTML) if the page is an HTML page.

Similar Messages

  • When viewed on QHD display, HTML messages are very narrow and zooming doesn't change width.

    I am migrating to a Lenovo Yoga Pro 2 with 3200x1600 13.3" display. I am using ESR17 due to plug-in compatability issues with newer versions (primarily the Funambol plugin for Calendar sync.) I have had to increase the font size to 24 to be able to see the folders and message subjects. I increased the font inside normal text messages using <ctrl><+> but when I view HTML messages, the formatted message body only fills 1/3 of the message pane and using <ctrl><+> only increases the size of the font inside this width resulting in more and more wrapping until single words have to be wrapped.o
    Is this issue fixed in a newer version of Thunderbird? Is there a Calendar sync client for Funambol (OneMediaHub) or Google Calendar that works with the newer version? (I have used Funambol to sync my Calendar with my phone (was BB, now Android) for many years.
    Thanks
    Gerard

    I have DPI set to 200. Most of Thunderbird 17 respects this but HTML messages do not. The scroll bar for message body is also verrry narrow. And the icons on the menu bar (e.g. Switch to Calendar Tab) are mircoscopic.
    You didn't say which version of Thunderbird addresses these QHD display issues.
    I have tried Google Calendar sync but I have had trouble with offline use. Last time I tried it Google's address book seems to be missing fields supported by Thunderbird's address book.

  • Mail doesn't display my html

    I'm tearing my hair out over this. Solve this for me and I'll love you forever! :-)
    I have a shell script running on a Linux machine to generate multipart mail messages. These display perfectly in Thunderbird (PC or Mac) but the html is missing when I open them in Mac mail. Switch to plain text and they look fine, but the html just doesn't display.
    I've tried Snow Leopard and Lion with the same result.
    Anyone come across this problem? Anyone any ideas?

    Thank you Austin, that was exactly the problem: the overall (multipart/mixed) boundary was properly terminated, but the others weren't.
    I must have looked at that a hundred times and not seen it. I've corrected that and now it's working.
    I guess thunderbird is just more tolerant of format deviation than Mac Mail!
    Just in case it's of interest, here's the complete structure of the message:
    MIME-Version: 1.0
    To: [email protected]
    Subject: New Facebook Competition
    From: [email protected]
    Content-Type: multipart/mixed;
        boundary="66666666-090002070900070700030205"
    --66666666-090002070900070700030205
    Content-Type: multipart/alternative;
        boundary=66666666-060505020108050808000403
    --66666666-060505020108050808000403
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
       charset=ISO-8859-15;
       format=flowed
    Guten Tag Herr Harris
    plain text message...
    --66666666-060505020108050808000403
    Content-Type: multipart/related;
        boundary=66666666-050209050401050301040304
    --66666666-050209050401050301040304
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/html;
       charset=ISO-8859-15
    <html>
    html message...
          <href="http: www.xxx.xx"><a class="moz-txt-link-abbreviated" href="http://www.xxx.xx">www.xxx.xx</a>
    <a href="http://www.facebook.com/my_fb_page">
    <p><img src="cid:[email protected]"
        alt="my page" border="0" height="20" width="20">
    </p></a>
            <br>
          </div>
    </html>
    --66666666-050209050401050301040304
    Content-Transfer-Encoding: base64
    Content-Disposition: inline;
       filename=FB_Button.jpg
    Content-Type: image/jpeg;
       name=FB_Button.jpg
    Content-Id: <[email protected]>
    /9j/4AAQSkZJRgABAQECWAJYAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    oWhr/L/GzQFvn4Rfx5ivbPouQACgvqx88uFeqCYYuZzS9qM1gWBfafx//9k=
    --66666666-050209050401050301040304--
    --66666666-060505020108050808000403--
    --66666666-090002070900070700030205
    Content-Disposition: attachment;
       filename=myphoto.jpg
    Content-Type: image/jpeg;
       name=myphoto.jpg
    Content-Transfer-Encoding: base64
    /9j/4AAQSkZJRgABAQEASABIAAD/4XKCRXhpZgAATU0AKgAAAAgACwEOAAIAAAAeAAAIngEP
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Zub3wbpd5JlZrmJUkwflxkDp+Ned+KJLa40eS1ktQ0ss6QmQv0Vm2nj6e9FFd0n7tzKktPkf
    /9k=
    --66666666-090002070900070700030205--

  • HTML messages with SMTPClient

    I'm trying to send HTML messages using the older SMTPClient class that comes with the earlier JDK's. I use an older version of CodeWarrior to write my code and it has problems with the new SDK. So I haven't downloaded the JavaMail API yet, it looks to me like this SMTPClient does everything I need. But I'm having problems sending HTML messages. I test my code by sending the messages to my own Outlook Express account. Outlook express interprets very simple HTML messages correctly, but as soon as I add more complicated tags it stops interpreting the message as HTML and just prints out the HTML source as plain text. This works fine:
    msg.println("<html><body bgcolor=#D67689>");
    msg.println("This works Fine!");
    msg.println("</html>");
    But I want to put together a slicker message than that. As soon as I add more code to the message, it is not interpreted properly.
    This does not work:
    msg.println("<html><body bgcolor=#D67689>");
    msg.println("Now I just get plainText!");
    msg.println("<img border=0 src=http://members.shaw.ca/bryantronsgard/IMAGES/FlowerBanner.jpg width=467 height=199>");
    msg.println("</html>");
    Do you have to follow some stricter tag schema when sending HTML over SMTP? Is there some trick I am missing?

    I know nothing of this SMTPClient, but if it doesn't support setting a message's content type to "text/html" then it doesn't do everything you need.

  • KNOWN ISSUE: HTML Messages with plain-text signatures

    To get around the EAS security policy issue, I'm having non-sensitive emails from work forwarded to a GMail account from a redirect set up in our corporate OWA. The redirect seems to send the messages to GMail without any issues; formatting is 100% intact, and in the GMail web client as well as Thunderbird, Entourage, etc., HTML emails with plain-text signature attachments show the plain-text message inline with the rest of the formatted message. All of our internal mailing lists have these plain text attachments that say where the message was coming from (Message sent from [email protected] by listserv). These get affixed to every message, both plain text and HTML.
    Here's my problem: The Pre's email client handles both plain text and HTML messages beautifully. But, when I receive a message from a mailing list with a plain text attachment, the HTML portion disappears, and all I see is the signature.
    Is there any way to make the Pre show the HTML INSTEAD of the plain text? I can live without the sig, I know where the messages are coming from already. But if I can't read the message, it's useless. I've only begun researching this and so far Google hasn't been much help, nor has searching these or other forums. Any help would be appreciated.
    Palm Pre P100EWW
    Post relates to: Pre p100eww (Sprint)
    Message Edited by HowellBP on 06-16-2009 04:13 PM

    1-51626418773
    I just got off the phone with Palm Support. Apparently this is a bug in the mail application. It currently does not support parsing both HTML and plain text in the same message. It will read EITHER plain text OR HTML, but not both at the same time. This will be fixed in a future update.

  • Only code in recieved html messages

    hi,
    when i recieve html messages with mail, some display correct, others are just code. ex:
    --=_5b9a6928f167e76571ef059d7b1ca14d
    Content-Type: text/plain; charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    test
    --=_5b9a6928f167e76571ef059d7b1ca14d
    Content-Type: text/html; charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.=
    w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns=3D"http://www.w3.=
    org/1999/xhtml" dir=3D"ltr" lang=3D"en"><html><head><meta http-equiv=3D"Con=
    there are a lot of threads regarding this problem with the email client "mail", but no solution.
    did apple released a patch yet?
    thanks

    maybe this helps more...
    Return-Path: <[email protected]>
    Delivered-To: [email protected]
    Received: (qmail 26064 invoked by uid 0); 5 May 2006 08:34:38 -0000
    Received: from unknown (HELO srv94-252.ip-tech.ch) (195.129.94.252)
    by blade1-7.iptech.localdomain with AES256-SHA encrypted SMTP; 5 May 2006 08:34:38
    -0000
    Received: (qmail 12980 invoked by uid 504); 5 May 2006 08:34:38 -0000
    Received: from unknown (HELO srv2-2.ip-tech.ch) (10.10.2.100)
    by 0 with SMTP; 5 May 2006 08:34:38 -0000
    Received: (qmail 14295 invoked by uid 65534); 5 May 2006 08:34:37 -0000
    Date: 5 May 2006 08:34:37 -0000
    Message-ID: <[email protected]>
    To: "martin knecht" <[email protected]>
    Subject: test
    X-PHP-Script: www.mikrokosmos-music.ch/shop/admin/mail.php for 62.202.75.246
    From: "mikrokosmos music" <[email protected]>
    MIME-Version: 1.0
    X-Mailer: Zen Cart Mailer
    Content-Type: multipart/alternative;
    boundary="=_59e34596dc5f8135e7c61b0bfb40f7d8"
    --=_59e34596dc5f8135e7c61b0bfb40f7d8
    Content-Type: text/plain; charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    test
    --=_59e34596dc5f8135e7c61b0bfb40f7d8
    Content-Type: text/html; charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.=
    i think the header information is ok, entourage and thunderbird do display the message correct...
    thanks<br>

  • HTML messages not displaying

    Not sure if this is the correct place to post this, but can't find a palce for apple mail.
    so here's my problem:
    Apple mail is not displaying some HTML email messages correctly.
    Most messages are fine, but some come through as text and html code.
    I have tried deleting the email account from apple mail and starting over with a new mailbox with no success.
    The same email will display fine on other computers, webmail and iOS devices, but incorrectly on my Macbook Pro.
    This was a problem in Snow Leopard, and has continued in Lion.
    Anyone have a solution?
    thanks

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, or by corruption of certain system caches. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • In Mail 3.6 remote images in HTML messages display as blue squares with ? even though checked in viewing references.

    In Mail 3.6 remote images in HTML messages display as blue squares with ? even though checked in viewing references.

    Nurit,
    The point is that that button should not be there, if the preference setting is as you say. This indicates the preference setting is stuck, and that is what I was trying to help you resolve.
    The full purge is done as follows:
    Quit Mail, and in the Finder open Home/Library and locate the Mail folder. Control-click over the Mail folder, and choose Duplicate -- then drag the resulting copy to the Desktop for temporary backup. Next, open Home/Library/Preferences and find the com.apple.mail.plist file and drag it to the desktop.
    Relaunch Mail, which will open as though new, and when prompted to import anything DECLINE. Instead, re-enter your account info, and Mail will re-discover the account folders for your accounts, and all should be well, after setting preferences as you desire.
    Ask any needed questions, and keep us posted.
    Ernie

  • HTML messages crash Mail

    Since this morning, every time I try to open an HTML message in Mail, it crashes. I don't have a problem with regular text e-mails, just HTML. I've repaired permissions, run Disk Utility and Disk Warrior, and I don't know how to proceed.
    Can anyone help, please?

    Hi lsgmilano, and a warm welcome to the forums if you han't been already!
    First I'd backup your whole Mail folder, by right clicking on it in the Finder, then choose Archive/Compress.
    Right click on that Mail folder, choose archive, you'll get everything in the folder, and the folder itself in a file called Mail.zip..
    Quit Mail, then In your home folder, try moving this +folder & file+ to the Desktop then reboot...
    /Users/YourUserName/Library/Caches/Mail
    Move to the Desktop...
    /Users/YourUserName/Library/Mail/Envelope Index

  • How can I redirect all messages to 2 another mail servers?

    Hi all
    ./imsimta version
    Sun Java(tm) System Messaging Server 7.3-11.01 64bit (built Sep 1 2009)
    libimta.so 7.3-11.01 64bit (built 19:54:45, Sep 1 2009)
    I wanted to redirect all messages(in and out) to another mail server, I configured as follows,
    - imta.cnf
    ! tcp_local
    tcp_local smtp mx single_sys ....... sourcefilter file:///backother.filter
    ! tcp_intranet
    tcp_intranet smtp mx single_sys ....... sourcefilter file:///backother.filter
    - backother.filter
    require ["fileinto"];
    if address :all :matches ["From"]["*"]{
    redirect "[email protected]";
    keep;
    stop;
    One e-mail account receives all messgaes and those messages will be kept in sender's or receiver's mail storage.
    I want , however, redirect all messages 2 or 3 mail servers.
    I tried several things to do this include edit backother.filter(this is written in Sieve ), but I failed.
    Is there any way to redirect messages to another mail servers?
    Any way would be good , using sieve script, make antoher channel or channel keyword
    Thanks
    Edited by: leeky41 on Mar 9, 2010 10:58 PM
    Edited by: leeky41 on Mar 9, 2010 11:06 PM
    Edited by: leeky41 on Mar 9, 2010 11:07 PM

    leeky41 wrote:
    Redirecting the message means it will not be delivered to the original recipient.I know so I wrote 'keep' keyword to deliver messages to the original recipient.
    capture "[email protected]";
    I tested it but the capture's behavior was very weird, subject had changed to something like,'deliverd status notice', sender had changed to postmaster and additional notice messgae inserted into mail body.The default sieve capture action encapsulates the email to keep a copy of both the envelope information and the original message. MS7u3 also supports the Exchange journal encapsulation format through the addition of the ":journal" parameter.
    I edited 'capture' like this..
    capture :message "[email protected]";
    The ":message" flag removes the encapsulation -- therefore you will have no idea of who the original sender/recipients were as the envelope information has been discarded.
    It worked fine. It was same as the result of 'redirect'.
    but the following line, sent10 messages to each recipients.(receive_01,receive_02)
    capture :message "[email protected],[email protected]";
    maybe there was some 'loop' actions happened.The email produced by the capture sieve action is being "captured" which is resulting in a loop. You can stop this by adding an envelope test e.g.
    require ["envelope"];
    if not envelope :is ["to"] ["[email protected]","[email protected]"]
            capture :message "[email protected]";
            capture :message "[email protected]";
    }Regards,
    Shane.

  • Am unable to install CS5 on mac running yosemite. Tried installing JavaFor OSX, it still doesn't  work. Error message reads "inconsistency in the installer database"

    Am unable to install CS5 on mac running yosemite. Tried installing JavaFor OSX, it still doesn't  work. Error message reads "inconsistency in the installer database"

    remove your caps database.  this shows the location for cs3.  make the obvious changes for cs5.
    Error "...Installer Database is Corrupt..." when you install Adobe Creative Suite 3 products

  • Download doesn't work  No error message

    I am trying hard to download oc4j release 2 and how-to-jazn sample .
    Site doesn't provide any error message if there is any error message if server is down . There is no problem if I dowm load from other sites.
    Can some one answer my question
    Thanks Praful

    Many people are having this problem for the last couple of days. This is a problem that Apple has to fix. If you look around the forum, you will see many, many discusssions about this and they have been going on for a few days.
    According to Fly150 in another discussion, this is a workaround - for the time being.
    If you want to update the Apps while waiting for Apple to fix Updates:
    1. Go to App Store
    2. Select Purchased
    3. Select All
    4. Scroll down to find the Apps showing update
    5. Select update on the Apps
    This should update the Apps and get rid of the update count in App Store.

  • My animation doesn't work in html page

    hi guys,i want you to help me , you know is so frustated to work for long being an animation and at the final doesn't work
    i've done an animation in flash using as3 code ,it's work perfetly.
    the problem is that when i insert it in my page nothing happens ,before to try with browser i test the swf with a play button in dreamweaver
    but nothing
    when i publized only the script is seen but the images not.
    i my server wamp on y computer under my folder for my website there is a folder named :images(for all images),on this folder i put the entire folder of my animation .
    but i don't know why it doesn't work
    i can say you all my animations with xml and AS3 in flash doesn't work in my page
    please give me a magic and quick solution
    thanks all of us for reading me
    my english isn't so much perfect
    bye

    thanks you for replying me
    but i solved it
    --- En date de : Lun 6.7.09, Nadia-P <[email protected]> a écrit :
    De: Nadia-P <[email protected]>
    Objet: My animation doesn't work in html page
    À: "augustine ngo ndjel" <[email protected]>
    Date: Lundi 6 Juillet 2009, 11h06
    It is very hard to help you without
    seeing your page... do you have the files uploaded to a
    server?  Can you post a link, so people can look at the
    code to see if they can find a solution for you.
    Nadia
    Adobe® Community Expert : Dreamweaver
    Unique CSS Templates |Tutorials |SEO Articles
    http://www.dreamweaverresources.com/
    http://csstemplates.com.au/

  • Adobe Digital Edition 4.0 doesn't run and a message appears

    Hello, ADE doesn't open and this message appears. What is the solution or which other software can I use? Thank you.

    note to moderator -   this is MY response to MY own posting.  How can this be a duplicate.
    success.  ADE 4.0 is to be avoided. It crashed after my solution.
    The solution is trash the activation.dat preference file.
    Navigate to /Users//Library/Application Support/Adobe/Digital Editions and drag the activation.dat file to the trash.
    If you are using 10.7, see Access hidden library files | Mac OS 10.7 and later.
    I reinstalled ADE 3.0 and life is good.
    The Error getting License. License Server Communication Problem: E_ACT_NOT_READY

  • Using images in an HTML message

    Dear All,
    I want to embed 2 .gif files as part of the HTML message which is being sent from one client to another..My clients want me to give them the same effect as Outlook express utility: New Using->Select Stationery->Filename...so that the text can be typed on the image & then sent...i have hardcoded the structure of the message but the problem is that i am only able to send this message & view it only on my m/c & my e-mail id....if i send it to some other id the picture is not displayed how do i handle this
    Thank You
    Chaitra

    import java.io.*;
    import java.util.*;
    import java.text.*;
    import javax.mail.*;
    import javax.servlet.*;
    import javax.activation.*;
    import javax.servlet.http.*;
    import javax.mail.internet.*;
    public class MailServlet
    extends HttpServlet
    protected void printForm(String form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws IOException
    PrintWriter writer = response.getWriter();
    form = MessageFormat.format(form,
    new Object[] { request.getServletPath() });
    writer.print(form);
    writer.flush();
    protected void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException
    printForm(request.getParameter("SendMailForm"),request,response);
    protected void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException
    try
    if(request.getContentType().
    startsWith("multipart/form-data"))
    doUpload(request,response);
    else
    response.sendError(
    HttpServletResponse.SC_NOT_FOUND);
    catch(Exception e)
    PrintWriter writer = response.getWriter();
    writer.println("<HR><B>Oops!</B><PRE>");
    e.printStackTrace(writer);
    writer.println("</PRE>");
    writer.flush();
    protected void doSendMessage(HttpServletRequest request,
    HttpServletResponse response,
    Dictionary fields)
    throws IOException, MessagingException
    String host = "10.10.40.6";
    Properties props = System.getProperties();
    props.put("mail.smtp.host", host);
    Session session =
    Session.getInstance(props, null);
    Message msg =
    new MimeMessage(
    session); /*.getDefaultInstance(
    System.getProperties(),null));*/
    msg.setFrom(
    new InternetAddress(
    (String)fields.get("from")));
    InternetAddress[] tos =
    InternetAddress.parse((String)fields.get("to"));
    msg.setRecipients(Message.RecipientType.TO,tos);
    if(fields.get("cc") != null)
    InternetAddress[] ccs =
    InternetAddress.parse((String)fields.get("cc"));
    msg.setRecipients(Message.RecipientType.CC,ccs);
    msg.setSubject((String)fields.get("subject"));
    msg.setSentDate(new Date());
    String msgText ="<HTML><HEAD><TITLE id=ridTitle>Eximbirthday</TITLE>";
         msgText+="<META http-equiv=Content-Type content=\"text/html; charset=windows-1252\"><BASE ";
         msgText+="href=d:/Tomcat/webapps/Project/>";
         msgText+="<META content=\"MSHTML 6.00.2600.0\" name=GENERATOR></HEAD>";
         msgText+="<BODY id=ridBody bgColor=#e7e4d9 leftMargin=0 topMargin=0 marginheight=0";
         msgText+="marginwidth=0>";
         msgText+="<CENTER></CENTER>";
         msgText+="<P></P>";
         msgText+="<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0>";
         msgText+="<TBODY>";
         msgText+="<TR>";
         msgText+="<TD vAlign=top align=left colSpan=2><IMG height=69 src=\"cid:hbday.gif\"";
         msgText+="width=366 border=0></TD></TR>";
         msgText+="<TR>";
         msgText+="<TD vAlign=top align=left width=\"65%\" height=2>";
         msgText+="<br><br><FONT color=#0000ff size=5>";
         msgText+=(String)fields.get("body");
         msgText+="</font></TD>";
         msgText+="<TD vAlign=bottom align=right height=2><IMG height=394 src=\"cid:flowers.gif\"";
         msgText+="width=296 border=0></TD></TR></TBODY></TABLE>";
         msgText+="<DIV> </DIV></BODY></HTML>";
         if(null == fields.get("attachment"))
    // msg.setText((String)fields.get("body"));
              msg.setContent(msgText,"text/html");
    else
    BodyPart body = new MimeBodyPart(),
    attachment =(BodyPart)fields.get("attachment");
    //body.setText((String)fields.get("body"));
              // body.setHeader("Content-Disposition", "inline; filename=flowers.gif");
              body.setContent(msgText, "text/html");
    MimeMultipart multipart = new MimeMultipart("related");
    multipart.addBodyPart(body);
    multipart.addBodyPart(attachment);
              body=new MimeBodyPart();
              DataSource fds = new FileDataSource("D:/Tomcat/webapps/Project/hbday.gif");
              body.setDataHandler(new DataHandler(fds));
    body.setHeader("Content-ID","hbday.gif");
         // Add part to multi-part
         multipart.addBodyPart(body);
              // Create 2nd part for the image
         body = new MimeBodyPart();
              // Fetch the image and associate to part
              DataSource fds2 = new FileDataSource("D:/Tomcat/webapps/Project/flowers.gif");
              body.setDataHandler(new DataHandler(fds2));
              body.setHeader("Content-ID","flowers.gif");
              // Add part to multi-part
              multipart.addBodyPart(body);
    msg.setContent(multipart);
    Transport.send(msg);
    response.sendRedirect(response.encodeRedirectURL("/Project/OkForm.jsp"));
    public void doUpload(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, MessagingException
    String boundary =
    request.getHeader("Content-Type");
    int pos = boundary.indexOf('=');
    boundary = boundary.substring(pos + 1);
    boundary = "--" + boundary;
    ServletInputStream in =
    request.getInputStream();
    byte[] bytes = new byte[512];
    int state = 0;
    ByteArrayOutputStream buffer =
    new ByteArrayOutputStream();
    String name = null,
    value = null,
    filename = null,
    contentType = null;
    Dictionary fields = new Hashtable();
    int i = in.readLine(bytes,0,512);
    while(-1 != i)
    String st = new String(bytes,0,i);
    if(st.startsWith(boundary))
    state = 0;
    if(null != name)
    if(value != null)
    fields.put(name,
    value.substring(0,
    // -2 to remove CR/LF
    value.length() - 2));
    else if(buffer.size() > 2)
    InternetHeaders headers =
    new InternetHeaders();
    MimeBodyPart bodyPart =
    new MimeBodyPart();
    DataSource ds =
    new ByteArrayDataSource(
    buffer.toByteArray(),
    contentType,filename);
    bodyPart.setDataHandler(
    new DataHandler(ds));
    bodyPart.setDisposition(
    "attachment; filename=\"" +
    filename + "\"");
    bodyPart.setFileName(filename);
    fields.put(name,bodyPart);
    name = null;
    value = null;
    filename = null;
    contentType = null;
    buffer = new ByteArrayOutputStream();
    else if(st.startsWith(
    "Content-Disposition: form-data") &&
    state == 0)
    StringTokenizer tokenizer =
    new StringTokenizer(st,";=\"");
    while(tokenizer.hasMoreTokens())
    String token = tokenizer.nextToken();
    if(token.startsWith(" name"))
    name = tokenizer.nextToken();
    state = 2;
    else if(token.startsWith(" filename"))
    filename = tokenizer.nextToken();
    StringTokenizer ftokenizer =
    new StringTokenizer(filename,"\\/:");
    filename = ftokenizer.nextToken();
    while(ftokenizer.hasMoreTokens())
    filename = ftokenizer.nextToken();
    state = 1;
    break;
    else if(st.startsWith("Content-Type") &&
    state == 1)
    pos = st.indexOf(":");
    // + 2 to remove the space
    // - 2 to remove CR/LF
    contentType =
    st.substring(pos + 2,st.length() - 2);
    else if(st.equals("\r\n") && state == 1)
    state = 3;
    else if(st.equals("\r\n") && state == 2)
    state = 4;
    else if(state == 4)
    value = value == null ? st : value + st;
    else if(state == 3)
    buffer.write(bytes,0,i);
    i = in.readLine(bytes,0,512);
    doSendMessage(request,response,fields);
    class ByteArrayDataSource
    implements DataSource
    byte[] bytes;
    String contentType,
    name;
    ByteArrayDataSource(byte[] bytes,
    String contentType,
    String name)
    this.bytes = bytes;
    if(contentType == null)
    this.contentType = "application/octet-stream";
    else
    this.contentType = contentType;
    this.name = name;
    public String getContentType()
    return contentType;
    public InputStream getInputStream()
    // remove the final CR/LF
    return new ByteArrayInputStream(
    bytes,0,bytes.length - 2);
    public String getName()
    return name;
    public OutputStream getOutputStream()
    throws IOException
    throw new FileNotFoundException();
    This is the latest version ....which again doesnt work!!!!!
    Thanx..
    Chaitra

Maybe you are looking for

  • Custom Column Name in Webpart file and Itemstyle for Content Query WebPart

    I was trying to incorporate  a custom column in the content Query WebPart. The name of the column displayed in the list is "Risk Score"; a calculated column. I right clicked on the field in the list settings and copy hte short cut which is pasted bel

  • Additive Cost and Variance Calcultion

    We started using Tcode CK74N to enter additive costs for certian materials. I did the configuration needed in the costing variant and added a cost element for additive costs in the cost component structure. Everything is working fine, when we run CK1

  • Calling function in PL/SQL

    Hello everyone, I would like to know if there is anyway to call a user defined function in an SQL statement from a PL/SQL anonymous block without first creating that function to the database. For instance: I have a pl/sql block: DECLARE BEGIN UPDATE

  • How to roll back to Acrobat Standard XI from Acrobat Standard DC Cloud

    Hi, How do we roll back/install Acrobat Standard XI from Acrobat Standard DC using the cloud? as we need to use Acrobat Standard XI? Thanks, Mike

  • No Administrator Account (Windows 8)

    I was helping my mom with her laptop because she kept complaining that she had to put a password in every time she logged on. There is only one user on her laptop. I looked online how to remove the log in password and it said to open Run and type net