Message subject,CC,header are displayed in the content part itself

This is the mail content i am getting::
>
Subject: Topic assigned in Discussion Forum
Cc: Some ID
Cc: Some ID
>
Mime-Version: 1.0
Content-Type: multipart/mixed;
     boundary="----=_NextPartTM-000-2291bc8c-42c6-473e-bf3a-1907e8a05eed"
This is a multi-part message in MIME format.
------=_NextPartTM-000-2291bc8c-42c6-473e-bf3a-1907e8a05eed
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
The following query has been assigned to sasasa
blah blah
------=_NextPartTM-000-2291bc8c-42c6-473e-bf3a-1907e8a05eed
Content-Type: text/plain;
     name="InterScan_Disclaimer.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
     filename="InterScan_Disclaimer.txt"
I am not setting the content type.
The content type is assumed by the mail server.
The code which i use is as follows::
public SendMail(Connection con,String incNo, String createdBy, String app, String priority,int upNo,String title,int flag)
String[] recipient_name = new String[10];
String[] recipient_mail_id = new String[10];
String sender_name = null;
String sender_id=null;
String msgText;
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy");
Calendar today = Calendar.getInstance();
String dt = sdf.format(today.getTime());
String dtinc=null;
System.out.println(createdBy+"creator");
try
Statement stmt = con.createStatement();
ResultSet rs1 = stmt.executeQuery(" select user_first_name + ' ' + user_last_name as user_name, e_mail as mail_id from Users where e_mail NOT IN ('','null') AND e_mail IS NOT NULL AND mailing_flag = 1 ");
int i=0;
while (rs1.next())
recipient_name[i] = rs1.getString("user_name");
recipient_mail_id[i] = rs1.getString("mail_id");
i++;
stmt = con.createStatement();
ResultSet rs2 = stmt.executeQuery(" select user_first_name + ' ' + user_last_name as user_name,e_mail as mail_id from Users " +
               " where user_id = '" + createdBy + "'");
rs2.next();
sender_name = rs2.getString("user_name");
sender_id = rs2.getString("mail_id");
System.out.println(createdBy+sender_name);
System.out.println(createdBy+sender_id);
catch (Exception ex)
System.out.println(ex);
msgText = "A new update has been created for " + app;
msgText = msgText + "\nIncident # : " + incNo;
msgText = msgText + "\nUpdate # : " + upNo;
msgText = msgText + "\nTitle : " + title;
msgText = msgText + "\nCreated on : " + dt;
msgText = msgText + "\nCreated by : " + sender_name;
msgText = msgText + "\nPriority : " + priority;
String from = sender_name;
String host = "mail server IP";
boolean debug = Boolean.valueOf("true").booleanValue();
Properties props = new Properties();
props.put("mail.smtp.host", host);
if (debug) props.put("mail.debug", "true");
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
try
Message msg = new MimeMessage(session);
if(sender_id ==null || sender_id.equals("null")||sender_id.equals(""))
     sender_id="Default";          
System.out.println("From :::::::"+sender_id);
msg.setFrom(new InternetAddress(sender_id,from));
if(recipient_name[0]!=null)
InternetAddress toAddress = new InternetAddress(recipient_mail_id[0],recipient_name[0]);
msg.setRecipient(Message.RecipientType.TO, toAddress);
for(int i=1;!(recipient_name==null);i++)
if(recipient_name[i]!=null)
InternetAddress ccAddress = new InternetAddress(recipient_mail_id[i],recipient_name[i]);
msg.addRecipient(Message.RecipientType.CC, ccAddress);
msg.setSubject("Update Notification for Incident #: " + incNo);
msg.setSentDate(new java.util.Date());
msg.setContent(msgText, "text/html");
Transport.send(msg);
catch (UnsupportedEncodingException ex)
System.out.println("\n--UnsupportedEncodingException in msgsendsample.java");
catch (MessagingException mex)
System.out.println("\n--Exception handling in msgsendsample.java");
mex.printStackTrace();
System.out.println();
Exception ex = mex;
do {
if (ex instanceof SendFailedException) {
SendFailedException sfex = (SendFailedException)ex;
Address[] invalid = sfex.getInvalidAddresses();
if (invalid != null) {
     System.out.println(" ** Invalid Addresses");
     if (invalid != null) {
          for (int i = 0; i < invalid.length; i++)
          System.out.println(" " + invalid[i]);
     Address[] validUnsent = sfex.getValidUnsentAddresses();
     if (validUnsent != null) {
          System.out.println(" ** ValidUnsent Addresses");
          if (validUnsent != null) {
          for (int i = 0; i < validUnsent.length; i++)
          System.out.println(" "+validUnsent[i]);
     Address[] validSent = sfex.getValidSentAddresses();
          if (validSent != null) {
          System.out.println(" ** ValidSent Addresses");
          if (validSent != null) {
          for (int i = 0; i < validSent.length; i++)
          System.out.println(" "+validSent[i]);
System.out.println();
} while ((ex = ((MessagingException)ex).getNextException())
                              != null);
return ;

Good to see some other person also waiting for a reply!!
Well i know that the problem may arise when the message.settext() is used instead of message.setcontent()...
Also i have this problem rectified now and the change we did was
---some of the mail ids had capital letters in it.we changed all the letters to small letters
---change the settext to setcontent
I dont know whether these are the correct solutions
but may be this could help in getting the correct solution!!!!!!!

Similar Messages

  • How do you change the fields that are displayed on the email preview list after a search?

    How do you modify the fields that are displayed in the mail preview list in the center column of Mac mail after you conduct a search of your email?   All of a sudden the displayed fields changed on me whenever I do a search in mail.   When I have not filtered my email with a search, the default field shown in bold at the top of each message's preview is the "From" field.   However, when I do a search this changes to the "To" field.   Can anyone help?   Thanks, ccarey

    ipicus
    But why would you want this?
    iTunes is responsible for the File Management, let it get on with it, you do your organisation in the iTunes window. And everything you need to do, you can do via the iTunes Window. Want to find the file of a track quickly? Right click on it in the iTunes Window and select Show File: A finder window pops open with the file already selected.
    Regards
    TD

  • TS4036 I've got a new iPad I'm trying to do an iCloud back up but keep being given the following message: no iCloud backups are compatible with the version of iOS (6.1.3) on this iPad. How do I restore I cloud on my new device?

    I've got a new iPad and am trying to do an iCloud backup but keep getting the following message: no iCloud backups are compatible with the version of iOS (6.1.3) on this iPad.
    How do I restore info from iCloud onto my new device?

    You would have to update your device first, before you can restore your iPad from your backup. Resolution: set it up as anew device, then update your device to the latest version "Settings > General > Updates", then reset your device again "Settings > General > Reset > Erase All Content and Settings" and then after the iPad restarts again, choose to restore your device from your backup.

  • Error message in .docx : 'Open XML file cannot be opened because there are problems with the contents. Details Unspecific error Location: 2'

    I have put a lot of work into a docx document on my Mac, but now can't open it as it gives the error message: 'the Open XML file cannot be opened because there are problems with the contents. Details, Unspecific
    error, Location: 2'
    When opening the original file the message said: 'this file contains word 2007 for Windows equations' etc. but I managed to track changes fine, and saved, closed and re-opened it numerous times without problem. Some graphs seemed moved, and various formulas
    were illegible, but no other weirdness was observed.
    I have microsoft 2008 installed on my Mac OS X version 10.6.8.
    I've tried to fix it using various solutions suggested here, but am afraid am too IT illiterate to have had any luck, please help I'm new to all this!
    I've uploaded it to https://www.dropbox.com/s/hkw9k6lyihzoxpc/SittwayPauktawSQUEACREPORT_KD%2BCH.docx

    Hi,
    This issue is related strictly to oMath tags and occurs when a graphical object or text box is anchored to the same paragraph that contains the equation.
    Please use the "Fix it" tool in the following KB article to resolve the problem. See:
    http://support.microsoft.com/kb/2528942
    Hope this helps.
    Regards,
    Steve Fan
    TechNet Community Support

  • How do I limit what movies are displayed at the top on the main screen

    Is there any way to limit what movies are displayed at the top on the main screen when menu Computers are selected?
    Currently it shows ALL of the content in the Movies folder in iTunes, but I would like to not show my 1 million 5-second videoclips and only the "real" movies.
    Any suggestions?
    Thanks in advance
    Bjoern Dirchsen

    I think you are right. It's the latest videos added that are displayed first. Makes sense.
    I'm using a PC so it's a bit hard to work with iPhoto . However, your comment did give me a hint to how to solve the problem.
    I moved all my video-clips out of my Movies folder and into my Pictures folder.
    Then I changed Photo Sharing in Itunes to include Videos
    And voila! The main screen now shows only my "real" movies. Sorted by latest added - but I guess that's the best we can do.
    Thanks for a super-fast answer.

  • When logging into iCloud in Safari, Calendar doesn't display any events. They are displayed on the iPad, iPhone on even the iCal. What is wrong ?

    When logging into iCloud in Safari, Calendar doesn't display any events. They are displayed on the iPad, iPhone on even the iCal. What is wrong ?

    :S,
    Sorry, missed that fact. My memory is good, but short.
    Try moving the "Calendar Cache" file to your Desktop. Quit iCal, and find the "Calendar Cache" file in your Macintosh HD/Users/yourusername/Library/Calendars. Move that file to your Desktop. After that, (I remember that I recommended this before), as long as you are moving files to the Desktop, repeat the plist removal procedure once again, log out/in or restart.
    You should also consider removing the "To Do's" from Mail before restarting iCal. When you open iCal turn off "Show Birthdays calendar" in iCal>Preferences...>General.
    Are you syncing any data? If so, what method(s) are you using?
    ;~)

  • How do I make attachments I receive in mail appear at the top of my messages?  Sometimes they are imbedded all the way at the bottom of an on going discussion and I don't even realize that there is an attachment.

    How do I make attachments I receive in mail appear at the top of my messages?  Sometimes they are imbedded all the way at the bottom of an on going discussion and I don't even realize that there is an attachment.

    If someone sends you an attachment, it's going to show up where they attached it in their message to you.
    Messages with attachments show a paper clip icon in two places, in the middle column of the Mail window, next to the senders name, and next to the sender's name at the top of the message itself.
    One way to make messages with attachments show more clearly is to create a Mail Rule, like this:
    By setting a colored background to the messages that contain attachments, they'll stand out pretty clearly in the message list.
    Note that there are several different types of attachments in the dropdown menu (where you see Document and PDF above). Keep pressing the plus sign to add different attachment types to your rule so that all will stand out on your list of messages.

  • App file sharing: files are displayed only the first time...

    clicking somewhere else and then back to the application that you want to share files are not there any more.
    I've to close and re-open the itunes in order to see them again.
    itunes is running on windows 7 64bit.
    is this a bug ?
    thank you.

    Hi! I have the same, exact problem. The files are displayed only the first time I look at the apps listed under File Sharing. If I look at another app on the list, the files on the one I previously checked are gone when I look at it again. Is there any way to fix this? I have a Lenovo X61s on Windows XP Professional 32 bit.

  • Developer Module only shows blue square with a white cross, images are displayed in the library ok but not im developer Module

    Ive just updated to LR 6 from LR 5.
    The app seemed to launch ok but as I was looking around none of my photos will open in the developer module, they just have a blue box with white cross??

    It seems to be something to do with Lightroom 6 accessing the GPU. I had this problem and under the "Performance" tab in "Preferences" (Edit menu), there's a box that says "Use graphics processor". I unticked this box and now the images are displayed in the developer module. I'll need to investigate further to find out why Lightroom is not working with my GPU but at least I can use it now.

  • The file .docx cannot be opened because there are problems with the contents in sharepoint document library

    I created a site and  created a document libarary and assigned a word document as a content type . I have written a workflow to create a new document . The workflow is working fine and all the document is getting created and values are getting stored
    in it .
    As per my requirement I am saving the above site as site template .
    After that I am creating a new site based on the above site template , Its getting created and I started the workflow , its working fine and the document is also getting created .
    The problem is I am getting error while opening the word document
    Error - The file filename.docx cannot be opened because there are problems with the contents .
    Details - No error details availble .
    Indresh

    What are you doing within the txt document?  Is it general text and string based items, or have you something more elaborate going on?
    An older discussion here elaborates a bit more on the dotx vs docx side of things.
    http://social.msdn.microsoft.com/Forums/en-US/de1b5ff9-ea6d-460c-a707-8c28acd4906f/error-opening-office-open-xml-file-when-using-sd-workflow-to-create-item-in-document-library?forum=sharepointcustomizationlegacy
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Cannot open Word File because "there are problems with the contents"

    Hi Everyone,
    I cannot open Word File because "there are problems with the contents" unspecified error; Location: 2.  Please help as I need this doc for work meeting this morning.  Nothing special about this doc but links were copied into it???  However I do that all the time.  I have never had this happen before.  I am on a 2010 machine.  I just ran a disk permissions repaired and emptied the trash but still no dice.  I had several other word docs up as well when I got up this morning but they are all fine.  I do not have Time Capsule turned on (which I need to do but that will be another thread/question).
    Thank you,
    sb

    Ok, I found a way to open this but not sure what happened to begin with and the formatting setup is different now, almost like text editor?  Not sure what happened here but hope it doesn't happen again?

  • Why since i have upgraded iphone  to io7 and upgraded itunes to the latest version that when i sync my iphone 5 with playlists the playlist are emplty yet the content still resides in itunes thgis is ******* me off as i have to use a playlist tomorrow

    why since i have upgraded iphone  to io7 and upgraded itunes to the latest version that when i sync my iphone 5 with playlists the playlist are emplty yet the content still resides in itunes thgis is ******* me off as i have to use a playlist tomorrow

    problem fixed when i updated iTunes with the latest update 11.1.1.11

  • Messages to /dev/sysmsg and /dev/console are displayed on the CDE Desktop

    I noticed that after reboots any message sent to /dev/sysmsg or /dev/console is displayed to the CDE Desktop (wallpaper). After I log out then log back in the problem disappears. This happens in global zones only and not in a non-global (local) zone.
    (the only service I see with "svcs -xv" is the Print Service)
    To repeat the problem I have to do the following:
    1. Reboot (init 6)
    2. Login to the CDE as a user.
    3. Open an Xterm window, and in the windows, "su" to root
    4. Observe a "su on ..." message on the CDE desktop in big white "OBP" looking mono-spaced text.
    5. Log out of the CDE
    6. Login to the CDE as a user.
    7. Open an Xterm window, and in the windows, "su" to root
    8. Problem has disappeared, no more logging of console like messages to the CDE desktop.
    As well, if I do something like this after I reboot, and on 1st log in:
    echo "Hi there" > /dev/console
    echo "Another Hello" > dev/sysmsg
    I'll see both messages print to the Desktop of the CDE. If I log out and log back in, I will no longer see this kind of behavior.
    My Hardware: Sun Netra CP3260
    My Software: Sun Solaris 10 5/08 Update 5 with 137137-09
    Additional info:
    /etc/syslog.conf - does have a line that directs some output to /dev/sysmsg
    /etc/default/su - does list: CONSOLE=/dev/console
    I did comment out the above two lines in my syslog.conf and /etc/default/su, and the behavior goes away, however this is a workaround and not a fix of the issue.
    Any ideas?
    Brian Jester
    Edited by: BrianJester on Apr 30, 2010 12:11 PM
    Edited by: BrianJester on Apr 30, 2010 12:22 PM

    Yes, I know this is an old post, but I’m trying to clean them up.
    Without your PowerShell script is will be impossible for anyone to answer this.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • All of a sudden my yahoo email wont display correctly (shows some links for inbox etc but they arnt clickable and no emails are displayed) and the links on facebook (notifications, home etc) dont display but facebook content does.

    Yahoo home page and yahoo email is not displaying correctly. It had been working fine until Saturday 9/10. When i load yahoo home page it will display content but some is not clickable and is not displayed correctly. In my email it will show the content on the left side (inbox, drafts etc and along the top (contacts, inbox etc) nothing can be clicked and no emails load or are shown. Facebook will load news feed content but will not display the icons at the left top (notifications, messages etc) they are clickable and work but the images just aren't there. Also not able to play games in facebook. The game loads up to 100% but never finishes. I dont go to many other website but i did check a few and they seem to be fine. May this be a website issue or firefox issue? i am able to use internet explorer to correctly see my email and facebook so assuming its a firefox thing.

    Hi
    Welcome, glad you got some benefit from the threads, it all so easy once you've done it a few times, aint it.
    Glad your going well, now you can help others  
    you could also join the folding team and help medical research.
    enjoy
    cheers
    jocko

  • ICal events are displayed in the local time zone, not at the time they are supposed to be

    When I enter events in iCal (or in my iPhone calendar), they always display at the time for the zone that I am currently in, even when they occur in a different time zone. For example, if I have a lunch scheduled at 12 pm Monday in Vancouver, I want to see that I have something scheduled at 12 pm on Monday, even if I am in Hong Kong. But even if I have time zone support enabled, the event appears at 4 am Tuesday. This makes it hard to look at the calendar and know what events I have scheduled for what times when I am doing a lot of travel. Is there anyway that I can get the event to show up at 12 pm on Monday no matter where I am in the world?
    Thanks

    This means you're still using Flex 1.5 as your runtime. SAP has introduced Flex 2 RT on SP14 patch 1 onwards. There were a lot of bug fixes and also several new functionality introduced there. I suggest you consider upgrading to the latest SP. Note that you can upgrade VC apart from the portal (only 3 SCAs to deploy) so this means you don't impact the portal itself and continue to have an up-to-date version of VC.
    If you want to solve your problem, I suggest you open a support ticket at SAP and once they see this, they'll let you have those SCAs.
    Regards,
    Natty

Maybe you are looking for

  • Stacked bar chart with single group

    Post Author: rt50896 CA Forum: Charts and Graphs Dear all,   I have a question about stacked bar chart with one group value(normally more than one group value is ok)   ex. YYYYMM      PRODUCT    AMT        -         200601          ABC            100

  • PDF printer "workaround"

    Is there anyone out there who can tell me how to generate a PDF file at 200% from InDesign CS5 now that the "PDF printer" option is no longer supported in "snow leopard."

  • Client side object model examples

    Hi, I wanted to learn more about client object model with examples.Can u please share some important urls to learn client object model with examples. Regards, Praveen

  • Underscan in boot camp

    When running Windows 7 from Boot Camp on my 15" MBP, my external ASUS 24" monitor has an underscan, in other words the image does not fill the entire screen.  How can I fix this? When running Windows within Parallels this does not happen, so it must

  • Re: Local Partitioning

    Hi, If you intend it on the first time you make a partitioning, just define your client node as Client only on the environment. So the environment visible service objects will automatically be assigned to server nodes. Hope this helps. Daniel Nguyen.