How should I write my emails to the forums?

When you write emails to the forums to start or respond to threads, you need to watch out for some potential problems in your message content.
Do not use square brackets in your message or subject. Square brackets are interpreted as command codes and can lead to unexpected results, including unreadable messages*.
Do not end a line in "wrote:". A line that ends in "wrote:" will be seen as a quoted message and from there onwards all content will be deleted. If you are used to classic quoting this will even result in a completely empty message.
Do not use a sequence of 5 hyphens ----- or underscores _____ as they will be removed together with everything after them.
If you quote messages with greater than signs ">", only quote one level deep and make sure there is a space after the greater than sign.
Do not append your signature to your email. The only people interested in your address, company affiliation, telephone number and email address are spammers and people who would like to steal your identity.
For best results use a 998 character line length limit in normal text, and a 72 character line length limit in quoted text.
* It is possible to use some very specific command codes in messages. See this document for instructions. Please note that these command codes are scheduled to change in a future update of these forums.

Target the LabVIEW RT Target - "switch execution target", then open the VI.  When you are targeted to a specific platform, your open VI runs there. 
Press go, and it is running on your target. 
You may want to look on the NI website for some RT tutorials to help you get started. 
http://www.ni.com/support/labview/real-time/
Preston Johnson
Principal Sales Engineer
Condition Monitoring Systems
Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
National Instruments
[email protected]
www.ni.com/mcm
www.ni.com/soundandvibration
www.ni.com/biganalogdata
512-683-5444

Similar Messages

  • How do I change my email for the forum?

    i can't see any way to change the email address i receive notifications from Apple Support Communities.
    is there a way to change the current email address in my profile?
    Thanks

    I'm not sure about this, but try clicking on "Manage your account" here:
    https://appleid.apple.com/cgi-bin/WebObjects/MyInfo.woa

  • I just upgraded to Firefox 8 from Internet Explorer. Previously, I pulled up my emails from Start, Email-Microsoft Office Outlook. I get no response doing that now. How should I get my emails?

    I just upgraded to Firefox 8 -- from Internet Explorer.
    Previously, I pulled up my emails from Start, Email-Microsoft Office Outlook.
    I get no response doing that now.
    How should I get my emails?

    If there are problems with importing the IE Favorites in Firefox then export the favorites in IE to an HTML file and import that file in the Firefox Bookmarks Manager.
    If you do not have the menu bar in IE then right-click the toolbar at the top to enable the Menu Bar.
    *Export the favorites in IE to an HTML file (bookmarks.html):<br>File > Import and Export
    *Import the HTML file in Firefox:<br>Bookmarks > Show All Bookmarks > Import & Backup > Import Bookmarks from HTML
    See "Import from another browser" and "Import from file":
    *http://kb.mozillazine.org/Import_bookmarks

  • How can I retrieve deleted emails from the trash?

    How do I retrieve deleted emails from the trash?  I have not emptied the trash.

    Take a look at this post. Several posts should apply: https://discussions.apple.com/message/23461582#23461582

  • How can I write new objects to the existing file with already written objec

    Hi,
    I've got a problem in my app.
    Namely, my app stores data as objects written to the files. Everything is OK, when I write some data (objects of a class defined by me) to the file (by using writeObject method from ObjectOutputStream) and then I'm reading it sequencially by the corresponding readObject method (from ObjectInputStream).
    Problems start when I add new objects to the already existing file (to the end of this file). Then, when I'm trying to read newly written data, I get an exception:
    java.io.StreamCorruptedException
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    Is there any method to avoid corrupting the stream? Maybe it is a silly problem, but I really can't cope with it! How can I write new objects to the existing file with already written objects?
    If anyone of you know something about this issue, please help!
    Jai

    Here is a piece of sample codes. You can save the bytes read from the object by invoking save(byte[] b), and load the last inserted object by invoking load.
    * Created on 2004-12-23
    package com.cpic.msgbus.monitor.util.cachequeue;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    * @author elgs This is a very high performance implemention of Cache.
    public class StackCache implements Cache
        protected long             seed    = 0;
        protected RandomAccessFile raf;
        protected int              count;
        protected String           cacheDeviceName;
        protected Adapter          adapter;
        protected long             pointer = 0;
        protected File             f;
        public StackCache(String name) throws IOException
            cacheDeviceName = name;
            f = new File(Const.cacheHome + name);
            raf = new RandomAccessFile(f, "rw");
            if (raf.length() == 0)
                raf.writeLong(0L);
         * Whne the cache file is getting large in size and may there be fragments,
         * we should do a shrink.
        public synchronized void shrink() throws IOException
            int BUF = 8192;
            long pointer = getPointer();
            long size = pointer + 4;
            File temp = new File(Const.cacheHome + getCacheDeviceName() + ".shrink");
            FileInputStream in = new FileInputStream(f);
            FileOutputStream out = new FileOutputStream(temp);
            byte[] buf = new byte[BUF];
            long runs = size / BUF;
            int mode = (int) size % BUF;
            for (long l = 0; l < runs; ++l)
                in.read(buf);
                out.write(buf);
            in.read(buf, 0, mode);
            out.write(buf, 0, mode);
            out.flush();
            out.close();
            in.close();
            raf.close();
            f.delete();
            temp.renameTo(f);
            raf = new RandomAccessFile(f, "rw");
        private synchronized long getPointer() throws IOException
            long l = raf.getFilePointer();
            raf.seek(0);
            long pointer = raf.readLong();
            raf.seek(l);
            return pointer < 8 ? 4 : pointer;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#load()
        public synchronized byte[] load() throws IOException
            pointer = getPointer();
            if (pointer < 8)
                return null;
            raf.seek(pointer);
            int length = raf.readInt();
            pointer = pointer - length - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            byte[] b = new byte[length];
            raf.seek(pointer + 4);
            raf.read(b);
            --count;
            return b;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#save(byte[])
        public synchronized void save(byte[] b) throws IOException
            pointer = getPointer();
            int length = b.length;
            pointer += 4;
            raf.seek(pointer);
            raf.write(b);
            raf.writeInt(length);
            pointer = raf.getFilePointer() - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            ++count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCachedObjectsCount()
        public synchronized int getCachedObjectsCount()
            return count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCacheDeviceName()
        public String getCacheDeviceName()
            return cacheDeviceName;
    }

  • How do I delete multiple emails at the same time rather than individually?

    How do I delete multiple emails at the same time rather than individually?

    My mistake
    I was looking at my KB, even tested my suggestion with the command key, and then wrote option
    Barry

  • How do I write a text below the Lower Third line, in Adobe Premiere Elements 12?

    How do I write a text below the Lower Third line, in Adobe Premiere Elements 12?

    Ruth Schreiber
    To what Premiere Elements 12 title template (lower 3rd type) are you referring?
    It is not clear what you want to do.
    a. Are you able to double click the template to open it in the program's Titler?
    b. Can you select the present text with the Selection Tool to move it to custom locations?
    c. Can you edit the existing text in the template?
    The following uses the Aquarium lower 3rd template...where do you want to write text in the template?
    We will be looking forward to your follow up.
    Thanks.
    ATR

  • HT5312 I do not know my security question answers. I send my answers send to my old email address but I cannot get into that anymore. How do I send my email to the email address I have now?

    I do not know my security question answers. I send my answers send to my old email address but I cannot get into that anymore. How do I send my email to the email address I have now?

    Hi RileyDP,
    You will have to contact iTunes Support to get them reset:
    http://support.apple.com/kb/HT5699?viewlocale=en_US
    or by email:
    https://ssl.apple.com/emea/support/itunes/contact.html
    Cheers,
    GB

  • Re: How do I leave my email on the email server using iPad 2 .

    Re: How do I leave my email on the email server using iPad 2 .
    The iPad 2 wipes the messages off the server when downloading...
    This option is not in advance settings for other email providers.

    You have to actually have another email account with a email provider. Whether that is your ISP or one of the free/paid email providers like Gmail, Yahoo, MS Outlook.

  • How to I stop getting email from the Apple Support Communities?

    How do I stop getting email from the Apple Support Communities?  I am being innundated with hundreds of emails daily.  Help~~

    If you are getting them from a forum as a whole (as opposed to just individual threads), then towards the top right of that forum page make sure that it says 'receive email notifications' in the Actions box :
    If it says 'stop email notifications' then click on it so as to stop them

  • How do I get my emails on the cloud

    How do I transfer my emails into the cloud?

    I have the same problem with the "me" account. If I change to "icloud" or "mac" the mails will received.

  • How can I write HTML code in this forums

    Sorry but I didn't know where to post this thread.....
    How can I write HTML code in this forums?

    Hello,
    Every piece of code in your post should be wrapped with the forum tags [ code] and [ /code], without the blanks.
    In case of the &lt;a> tag, that is not enough. In this case, you have several options. The most elegant one is to use the entity name for the less-then sign - & lt; - without any spaces. Other options is to add a space between the less-then and the ‘a’ character (and make a note of it) or change the less-then character with a left bracket one.
    When posting code, you should always use the forum preview option, just to make sure the forum software “understood” your code correctly.
    Hope this helps,
    Arie.

  • How do you write a file involving the changes in application engine?

    Hi Guys,
    I have a requirement in app engine.
    I have to update a table based on the changes occured in other tables.
    I have to show the user old value and new updated value in the log file how do I write a file for below fields?
    Old Value: Name:Rock|SSN:0000000|Address:675478
    New Value    Name: Roger|SSN:0000000|Address:908765
    Thanks and regards,

    Hi ,
    My Requirement is Quite different here.
    I cannot use CI.i have to implement in app engine.
    Below explained:
    I have data coming from abc table and populating into xyz table.
    So if any field in abc gets changed which is extracted and populated in the xyz table.I have to show the old field value of xyz and the new field values of abc which I am going to insert into the xyz.
    My log file should have both the values.
    how do I write both the values and update it:
    say I have value from abc.id=12 and xyz.id=12
    when we update abc.id=13 and xyz.id=14
    I have to print
    old record details:
    id=12
    New record details:
    id=13
    somerthing of above sort
    Thanks and Regards

  • How do I read a Email from the MS exchange server

    could any one tell me as to how i could read the mail from the exchange server and store it in a seperate folder.

    I have an application which reads the mail from our mail server and then writes the body of the message into a file and then deletes the email anf those values are then read from that file and stored into the database .
    Here is the code which pops the mail from the exchange server and then stores it into a file .
    import javax.mail.*;
    import com.sun.mail.pop3.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.util.*;
    * Title:
    * Description:
    * Copyright: Copyright (c) 2001
    * Company:
    * @author
    * @version 1.0
    public class SunMailConnection implements Runnable{
         boolean suspendFlag;
         ErrorLogWriter log = new ErrorLogWriter("SunMail.log");
         public SunMailConnection() {
              this.start() ;
         public void run(){
              try {
                   int start = 1;int end = -1;
                   String host = "cyde-cehh-exh1";//the local exchange server name AND DOESNT WORK IF U CONNECT TO EXT MAIL SERVER DIRECTLY
                   //DUE TO SECURED AUTHORISATION
                   //String host ="http://www.conergy-electronics.de";
                   String username ="SunReader\\Sun\\saa";
                   String password = "xxxxx";
                   // Create empty properties
                   Properties props = new Properties();
                   props.put("mail.protocol.store","pop3");
                   // Get session
                   Session session = Session.getDefaultInstance(props, null);
                   Provider[] p = session.getProviders();
                   //for (int i=0;i<p.length;i++) System.out.println(p.getProtocol());
                   // Get the store
                   Store store = session.getStore("pop3");
                   store.connect(host, username, password);
                   // Get folder
                   Folder folder = store.getFolder("INBOX");
                   if (folder == null || !folder.exists()) {
                        //System.out.println("Invalid folder: " + folder.getName());
                        log.write("Invalid folder: " + folder.getName()) ;
                        System.exit(1);
                   folder.open(Folder.READ_WRITE);
                   //Get the number of Unread Messages
                   int count = folder.getUnreadMessageCount();
                   if (count == 0) { // No messages in the source folder
                        //System.out.println(folder.getName() + " is empty");
                        // Close folder, store and return
                        folder.close(false);
                        store.close();
                        return;
                   if (end == -1)
                        end = count;
                   // Get the message objects to copy
                   log.write("Test");
                   Message[] msgs = folder.getMessages(start, end);
                   //System.out.println("Moving " + msgs.length + " messages");
                   //log.write("Moving " + msgs.length + " messages") ;
                   if (msgs.length != 0) {
                        //If there is any mail
                        //System.out.println(msgs.length );
                        //read mail from server into files
                        MoveMessageTo saveFile = new MoveMessageTo(msgs);
                        if(saveFile.createdFile=true){
                             folder.setFlags(msgs,new Flags(Flags.Flag.SEEN),true);
                             //delete flag set here to remove the email from INBOX
                             folder.setFlags(msgs, new Flags(Flags.Flag.DELETED), true);
                        //folder.expunge(); //removes messages marked as deleted
                        //check for deleting messages
                        for (int i = 0; i < msgs.length; i++) {
                             if (!msgs[i].isSet(Flags.Flag.DELETED))
                                  log.write("Message # "+msgs[i]+" not deleted.");
                             //else System.out.println("Message "+i+"-is deleted") ;
                   // Close connection
                   folder.close(true);
                   // dfolder.close(false);
                   store.close();
                   //this.start() ;
              }catch (Exception ex) {
                   ex.printStackTrace() ;
              //this.t.start();
         public void start(){
              try {
                   while(this!= null){
                        this.run() ;
                        Thread.sleep(15000);//every 15 seconds
              }catch (Exception ex) {
                   ex.printStackTrace();
         public void exit(){
              this.exit();
              System.out.println("Exit");
         public static void main(String[] args) {
              SunMailConnection sunMail = new SunMailConnection();
    This is to show the messages
    import java.util.*;
    import java.io.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    public class msgshow {
    static String protocol;
    static String host = null;
    static String user = null;
    static String password = null;
    static String mbox = "INBOX";
    static String url = null;
    static int port = -1;
    static boolean verbose = false;
    static boolean debug = false;
    static boolean showStructure = false;
    static boolean showMessage = false;
    public static void main(String argv[]) {
         int msgnum = -1;
         int optind;
         protocol = "pop3";
         host="cyde-cehh-exh1";
         user="SunReader\\Sun\\saa";
         password="xxxxxx";
         mbox="INBOX";
         /*for (optind = 0; optind < argv.length; optind++) {
         if (argv[optind].equals("-T")) {
              protocol = argv[++optind];
         } else if (argv[optind].equals("-H")) {
              host = argv[++optind];
         } else if (argv[optind].equals("-U")) {
              user = argv[++optind];
         } else if (argv[optind].equals("-P")) {
              password = argv[++optind];
         } else if (argv[optind].equals("-v")) {
              verbose = true;
         } else if (argv[optind].equals("-D")) {
              debug = true;
         } else if (argv[optind].equals("-f")) {
              mbox = argv[++optind];
         } else if (argv[optind].equals("-L")) {
              url = argv[++optind];
         } else if (argv[optind].equals("-p")) {
              port = Integer.parseInt(argv[++optind]);
         } else if (argv[optind].equals("-s")) {
              showStructure = true;
         } else if (argv[optind].equals("-m")) {
              showMessage = true;
         } else if (argv[optind].equals("--")) {
              optind++;
              break;
         } else if (argv[optind].startsWith("-")) {
              System.out.println(
    "Usage: msgshow [-L url] [-T protocol] [-H host] [-p port] [-U user]");
              System.out.println(
    "\t[-P password] [-f mailbox] [msgnum] [-v] [-D] [-s]");
              System.out.println(
    "or msgshow -m [-v] [-D] [-s] < msg");
              System.exit(1);
         } else {
              break;
         try {
         // if (optind < argv.length)
         // msgnum = Integer.parseInt(argv[optind]);
              //msgnum = 5;
         // Get a Properties object
         Properties props = System.getProperties();
         // Get a Session object
         Session session = Session.getDefaultInstance(props, null);
         session.setDebug(debug);
         if (showMessage) {
              MimeMessage msg = new MimeMessage(session, System.in);
              dumpPart(msg);
              System.exit(0);
         // Get a Store object
         Store store = null;
         if (url != null) {
              URLName urln = new URLName(url);
              store = session.getStore(urln);
              store.connect();
         } else {
              if (protocol != null)
              store = session.getStore(protocol);
              else
              store = session.getStore();
              // Connect
              if (host != null || user != null || password != null)
              store.connect(host, port, user, password);
              else
              store.connect();
         // Open the Folder
         Folder folder = store.getDefaultFolder();
         if (folder == null) {
              System.out.println("No default folder");
              System.exit(1);
         folder = folder.getFolder(mbox);
         if (folder == null) {
              System.out.println("Invalid folder");
              System.exit(1);
         // try to open read/write and if that fails try read-only
         try {
              folder.open(Folder.READ_WRITE);
         } catch (MessagingException ex) {
              folder.open(Folder.READ_ONLY);
         int totalMessages = folder.getMessageCount();
         if (totalMessages == 0) {
              System.out.println("Empty folder");
              folder.close(false);
              store.close();
              System.exit(1);
         if (verbose) {
              int newMessages = folder.getNewMessageCount();
              System.out.println("Total messages = " + totalMessages);
              System.out.println("New messages = " + newMessages);
              System.out.println("-------------------------------");
         if (msgnum == -1) {
              // Attributes & Flags for all messages ..
              Message[] msgs = folder.getMessages();
              // Use a suitable FetchProfile
              FetchProfile fp = new FetchProfile();
              fp.add(FetchProfile.Item.ENVELOPE);
              fp.add(FetchProfile.Item.FLAGS);
              fp.add("X-Mailer");
              folder.fetch(msgs, fp);
              for (int i = 0; i < msgs.length; i++) {
              System.out.println("--------------------------");
              System.out.println("MESSAGE #" + (i + 1) + ":");
              dumpEnvelope(msgs[i]);
              // dumpPart(msgs[i]);
         } else {
              System.out.println("Getting message number: " + msgnum);
              Message m = null;
              try {
              m = folder.getMessage(msgnum);
              dumpPart(m);
              } catch (IndexOutOfBoundsException iex) {
              System.out.println("Message number out of range");
         folder.close(false);
         store.close();
         } catch (Exception ex) {
         System.out.println("Oops, got exception! " + ex.getMessage());
         ex.printStackTrace();
         System.exit(1);
         System.exit(0);
    public static void dumpPart(Part p) throws Exception {
         if (p instanceof Message)
         dumpEnvelope((Message)p);
         /** Dump input stream ..
         InputStream is = p.getInputStream();
         // If "is" is not already buffered, wrap a BufferedInputStream
         // around it.
         if (!(is instanceof BufferedInputStream))
         is = new BufferedInputStream(is);
         int c;
         while ((c = is.read()) != -1)
         System.out.write(c);
         pr("CONTENT-TYPE: " + p.getContentType());
         String filename = p.getFileName();
         if (filename != null)
         pr("FILENAME: " + filename);
         * Using isMimeType to determine the content type avoids
         * fetching the actual content data until we need it.
         if (p.isMimeType("text/plain")) {
         pr("This is plain text");
         pr("---------------------------");
         if (!showStructure)
              System.out.println((String)p.getContent());
         } else if (p.isMimeType("multipart/*")) {
         pr("This is a Multipart");
         pr("---------------------------");
         Multipart mp = (Multipart)p.getContent();
         level++;
         int count = mp.getCount();
         for (int i = 0; i < count; i++)
              dumpPart(mp.getBodyPart(i));
         level--;
         } else if (p.isMimeType("message/rfc822")) {
         pr("This is a Nested Message");
         pr("---------------------------");
         level++;
         dumpPart((Part)p.getContent());
         level--;
         } else if (!showStructure) {
         * If we actually want to see the data, and it's not a
         * MIME type we know, fetch it and check its Java type.
         Object o = p.getContent();
         if (o instanceof String) {
              pr("This is a string");
              pr("---------------------------");
              System.out.println((String)o);
         } else if (o instanceof InputStream) {
              pr("This is just an input stream");
              pr("---------------------------");
              InputStream is = (InputStream)o;
              int c;
              while ((c = is.read()) != -1)
              System.out.write(c);
         } else {
              pr("This is an unknown type");
              pr("---------------------------");
              pr(o.toString());
         } else {
         pr("This is an unknown type");
         pr("---------------------------");
    public static void dumpEnvelope(Message m) throws Exception {
         pr("This is the message envelope");
         pr("---------------------------");
         Address[] a;
         // FROM
         if ((a = m.getFrom()) != null) {
         for (int j = 0; j < a.length; j++)
              pr("FROM: " + a[j].toString());
         // TO
         if ((a = m.getRecipients(Message.RecipientType.TO)) != null) {
         for (int j = 0; j < a.length; j++)
              pr("TO: " + a[j].toString());
         // SUBJECT
         pr("SUBJECT: " + m.getSubject());
         // DATE
         Date d = m.getSentDate();
         pr("SendDate: " +
         (d != null ? d.toString() : "UNKNOWN"));
         // FLAGS
         Flags flags = m.getFlags();
         StringBuffer sb = new StringBuffer();
         Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags
         boolean first = true;
         for (int i = 0; i < sf.length; i++) {
         String s;
         Flags.Flag f = sf[i];
         if (f == Flags.Flag.ANSWERED)
              s = "\\Answered";
         else if (f == Flags.Flag.DELETED)
              s = "\\Deleted";
         else if (f == Flags.Flag.DRAFT)
              s = "\\Draft";
         else if (f == Flags.Flag.FLAGGED)
              s = "\\Flagged";
         else if (f == Flags.Flag.RECENT)
              s = "\\Recent";
         else if (f == Flags.Flag.SEEN)
              s = "\\Seen";
         else
              continue;     // skip it
         if (first)
              first = false;
         else
              sb.append(' ');
         sb.append(s);
         String[] uf = flags.getUserFlags(); // get the user flag strings
         for (int i = 0; i < uf.length; i++) {
         if (first)
              first = false;
         else
              sb.append(' ');
         sb.append(uf[i]);
         pr("FLAGS: " + sb.toString());
         // X-MAILER
         String[] hdrs = m.getHeader("X-Mailer");
         if (hdrs != null)
         pr("X-Mailer: " + hdrs[0]);
         else
         pr("X-Mailer NOT available");
    static String indentStr = " ";
    static int level = 0;
    * Print a, possibly indented, string.
    public static void pr(String s) {
         if (showStructure)
         System.out.print(indentStr.substring(0, level * 2));
         System.out.println(s);
    This code is to move the message into a file
    import javax.mail.*;
    import com.sun.mail.pop3.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.util.*;
    import java.io.*;
    //This class copies the content of the received e-mail into files. The file names are given by
    //the urgent flag value and the subject
    public class MoveMessageTo {
         boolean createdFile = true;
         static final byte urgentFlagPos=13;
         public MoveMessageTo() {
         public MoveMessageTo(Message[] msgs) {
              if(msgs.length != 0)
              try {
                   for(int i = 0;i<msgs.length ;i++){
                        //Reads the content of the mail into an Object
                        Object currMultipart = msgs[i].getContent();
                        //converts this object into a String and then to a byte array, so we can read the urgnet flag
                        String content=(String)currMultipart;
                        byte[] testBytes=content.getBytes();
                        //The urgent flag is the first digit in the filename
                        StringBuffer fileName=new StringBuffer();
                        if (testBytes.length>urgentFlagPos)
                             fileName.append(new Byte(testBytes[urgentFlagPos]).toString());
                        //Then comes the subject of the e-mail
                        String mailSubject=msgs[i].getSubject();
                        if (mailSubject.length()>0)
                             fileName.append(mailSubject);
                        else fileName.append("noSubject");
                        fileName.append(".dat");
                        //create a directory to save the files
                        File baseDir = new File("c:/EMails/New");
                        baseDir.mkdirs();
                        //create file for with the subject as name
                        File eFile = new File(baseDir+"/"+fileName.toString());// creates a file by name of email subject
                        //Opening an stream for writting to the files
                        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(eFile));
                        ObjectOutputStream oos = new ObjectOutputStream(bos);
                        //Writing the message body to the file
                        oos.writeObject(currMultipart) ;
                        //Closing the stream
                        oos.flush() ;
                        oos.close() ;
                        createdFile = true;
              }catch (Exception ex) {
                   createdFile = false;
                   System.out.println("eFile is not created ");
                   ex.printStackTrace() ;
         public static void main(String[] args) {
              MoveMessageTo moveMessageTo1 = new MoveMessageTo();
    This code is if there is an error in reading a file it will write those error into the file
    import java.io.*;
    import javax.swing.*;
    import java.awt.Color;
    import javax.swing.border.*;
    //This class appends an error message to the log file
    public class ErrorLogWriter {
         //JPanel jPanel2 = new JPanel();
         //Border border1;
         String logDirectory="c:/EMails/log/";
         File errFile; //= new File(errDir+"/"+"errorLog.dat");
         //The constructor initializes the errFile given the filename
         public ErrorLogWriter(String fileName) {
              errFile=new File(logDirectory+fileName);
              /*try {
                   jbInit();
              }catch(Exception e) {
                   e.printStackTrace();
         public void write(String writeStr){
              try {
                   //Creates directory if doesn't exist
                   File errDir = new File(logDirectory);
                   errDir.mkdirs() ;
                   //If the directory exists...
                   if(errDir.isDirectory()){
                        //File errFile = new File(errDir+"/"+"errorLog.dat");
                        byte[] lastContent=new byte[0];
                        //If there is already a file with this name: Read its content so it can be preserved
                        if (errFile.exists()){
                             FileInputStream fis=new FileInputStream(errFile);
                             //Read everything into the byte array
                             lastContent=new byte[fis.available()];
                             fis.read(lastContent);
                        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(errFile));
                        PrintWriter oos = new PrintWriter(bos);
                        String newWriteString=new String(lastContent);
                        writeStr.trim() ;
                        //Appends the new string to the old content
                        newWriteString+=writeStr;
                        newWriteString+="\n";
                        //writes everthing back to the file
                        oos.write(newWriteString) ;
                        oos.flush();
                        oos.close();
              }catch (Exception ex) {
                   ex.printStackTrace() ;
         public static void main(String[] args) {
              ErrorLogWriter log = new ErrorLogWriter("logerror.log");
              log.write("Hello Log!") ;
    All these file are in one package called SunMail and i run this in jbuilder in 4.0 ,I get the following error
    eFile is not created
    java.lang.ClassCastException: javax.mail.internet.MimeMultipart
         at MoveMessageTo.<init>(MoveMessageTo.java:26)
         at SunMailConnection.run(SunMailConnection.java:86)
         at SunMailConnection.start(SunMailConnection.java:118)
         at SunMailConnection.<init>(SunMailConnection.java:21)
         at SunMailConnection.main(SunMailConnection.java:133)
    I know the it would be difficult if anyone could help me out it would be a great favour !!!
    pls help me out of this !!!!

  • E-mailing: How to sent out an email to the Managers OUTLOOK express account

    Hi Experts,
    System is ECC6.0.
    I hv requirement that, the sales orders comes from EDI into SAP. If there is a error in material (like,
    non-sellable, not existing etc.), I need to trap this issue/error.....................fine, I did it and working fine.
    But, in next step, I need to send out an email to the manager to his/her OUTLOOOK express(NOT work flow account) email account"s inbox, with a standard specified format!!!!
    I do NOT think, work flow is necessorily involved here in this scenario!!!
    So, let me know that,
    1) Is WORK FLOW involvment i there?
    2) How to get it done that, sending out email to OUTLOOK express account with a standard format
    3) Any FMs, piece of code
    replies appreciated.
    Edited by: SAP ABAPer on Sep 6, 2008 3:34 PM
    Edited by: SAP ABAPer on Sep 6, 2008 3:35 PM

    Hello
    I can offer two proposals:
    1) Standard report RSEIDOCA is used to actively monitor IDoc processing.
    This report can be scheduled in background and reports failed IDocs. Unfortunately SAP did not offer e-mail notification together with this report which is really a shortcoming. However, I have written a modified version of this report which allows to send e-mails (see below).
    2) Another scenario we are using is to replace wrong partners/materials with dummy partners or materials ensuring that the IDoc will be processed under all circumstances. In this case we set the Purchase order number supplement (sales order -> header -> tabstrip Order Data: field VBAK-BSTZD) = 'ERR'.
    Using a condition (transaction VOFM ) we trigger an ORDRSP IDoc if a new sales order has BSTZD = 'ERR'. This IDoc is forwared to SAP-XI and translated into an e-mail to the customer service.
    The crucial parts of my report ZRSEIDOCA are shown below (adjust selection screen and notification routine):
    ...*    perform show_act_moni.
    **    PERFORM send_notification.
        PERFORM _send_email_notification.
        MESSAGE s596.
      ELSE." keine Benachrichtigung
        MESSAGE s597.
      ENDIF.
    *&      Form  _SEND_NOTIFICATION
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM _send_email_notification.
    * define local data
    * All activities done via facade CL_BCS!
      DATA: lo_send_request       TYPE REF TO cl_bcs.
      DATA: lt_text               TYPE bcsy_text.
      DATA: lo_document           TYPE REF TO cl_document_bcs.
      DATA: lo_sender             TYPE REF TO cl_sapuser_bcs.
      DATA: lo_recipient          TYPE REF TO if_recipient_bcs.
      DATA: lo_bcs_exception      TYPE REF TO cx_bcs.
      DATA: lx_sent_to_all        TYPE os_boolean.
      DATA: ls_edidc              TYPE edidc,
            lo_idoc               TYPE REF TO zcl_idoc,
            lif_idoc              TYPE REF TO zif_idoc,
            ls_text               TYPE soli,
            ld_text(50)           TYPE c,
            ld_subject            TYPE so_obj_des,
            ld_date(10)           TYPE c,
            ld_time(8)            TYPE c.
      TYPES: BEGIN OF ty_s_idocdata.
      INCLUDE TYPE vbak AS vbak RENAMING WITH SUFFIX _vbak.
      INCLUDE TYPE kna1 AS kna1 RENAMING WITH SUFFIX _kna1.
      TYPES: END OF ty_s_idocdata.
      DATA: ls_idocdata   TYPE ty_s_idocdata.
      TRY.
    *     -------- create persistent send request ------------------------
          lo_send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
    *     create document from internal table with text
    **      APPEND 'Hello world!' TO lt_text.
    **      lo_document = cl_document_bcs=>create_document(
    **                      i_type    = 'RAW'
    **                      i_text    = lt_text
    **                      i_length  = '12'
    **                      i_subject = 'test created by ZRSEIDOCA' ).
          ld_subject = 'IDoc Monitoring'.
          WRITE syst-datum TO ld_date DD/MM/YYYY.
          WRITE syst-uzeit TO ld_time.
          CONCATENATE ld_subject syst-slset
            INTO ld_subject SEPARATED BY space.
          CONCATENATE ld_subject ':' INTO ld_subject.
          CONCATENATE ld_subject ld_date 'at' ld_time
            INTO ld_subject SEPARATED BY space.
          LOOP AT i_edidc INTO ls_edidc.
            " Create IDoc instance
            CLEAR: lo_idoc,
                   ls_idocdata.
            lo_idoc = zcl_idoc=>create_by_idoc_control( ls_edidc ).
            IF ( lo_idoc IS BOUND ).
              lif_idoc ?= lo_idoc.
              CALL METHOD lif_idoc->get_specific_data
                CHANGING
                  c_data = ls_idocdata.
            ELSE.
            ENDIF.
            WRITE ls_edidc-docnum TO ls_text-line NO-ZERO.
            CONDENSE ls_text-line.
            IF ( ls_idocdata-vbak IS NOT INITIAL ).
              CONCATENATE 'POnumber' ls_idocdata-bstnk_vbak
                INTO ld_text SEPARATED BY '='.
              CONCATENATE ls_text-line ld_text
                INTO ls_text-line SEPARATED BY space.
              WRITE ls_idocdata-bstdk_vbak TO ld_text DD/MM/YYYY.
              CONCATENATE 'POdate' ld_text
                INTO ld_text SEPARATED BY '='.
              CONCATENATE ls_text-line ld_text
                INTO ls_text-line SEPARATED BY space.
              IF ( ls_idocdata-kunnr_vbak IS NOT INITIAL ).
                CONCATENATE 'Customer' ls_idocdata-kunnr_vbak
                  INTO ld_text SEPARATED BY '='.
                CONCATENATE ls_text-line ld_text
                  INTO ls_text-line SEPARATED BY space.
              ENDIF.
              IF ( ls_idocdata-name1_kna1 IS NOT INITIAL ).
                CONCATENATE '(' ls_idocdata-name1_kna1 ')'
                  INTO ld_text.
                CONCATENATE ls_text-line ld_text
                  INTO ls_text-line SEPARATED BY space.
              ENDIF.
            ENDIF.
            APPEND ls_text TO lt_text.
          ENDLOOP.
          lo_document = cl_document_bcs=>create_document(
                          i_type    = 'RAW'
                          i_text    = lt_text
    **                      i_length  = '12'
                          i_subject = ld_subject ).
    *     add document to send request
          CALL METHOD lo_send_request->set_document( lo_document ).
    *     --------- set sender -------------------------------------------
    *     note: this is necessary only if you want to set the sender
    *           different from actual user (SY-UNAME). Otherwise sender is
    *           set automatically with actual user.
          lo_sender = cl_sapuser_bcs=>create( sy-uname ).
          CALL METHOD lo_send_request->set_sender
            EXPORTING
              i_sender = lo_sender.
    *     --------- add recipient (e-mail address) -----------------------
    *     create recipients - please replace e-mail address !!!
          LOOP AT o_email.
            lo_recipient = cl_cam_address_bcs=>create_internet_address(
                                              o_email-low ).
    *       add recipient with its respective attributes to send request
            CALL METHOD lo_send_request->add_recipient
              EXPORTING
                i_recipient = lo_recipient
                i_express   = 'X'.
          ENDLOOP.
    *     ---------- send document ---------------------------------------
          TRY.
              CALL METHOD lo_send_request->set_status_attributes
                EXPORTING
                  i_requested_status = 'N'  " suppress delivery confirmation
                  i_status_mail      = 'E'.
            CATCH cx_send_req_bcs .
          ENDTRY.
          TRY.
              CALL METHOD lo_send_request->set_send_immediately
                EXPORTING
                  i_send_immediately = 'X'.
            CATCH cx_send_req_bcs .
          ENDTRY.
          CALL METHOD lo_send_request->send(
            EXPORTING
              i_with_error_screen = 'X'
            RECEIVING
              result              = lx_sent_to_all ).
          IF lx_sent_to_all = 'X'.
            WRITE text-003.
          ENDIF.
          COMMIT WORK.
    * *                     exception handling
    * * replace this very rudimentary exception handling
    * * with your own one !!!
        CATCH cx_bcs INTO lo_bcs_exception.
          WRITE: text-001.
          WRITE: text-002, lo_bcs_exception->error_type.
          EXIT.
      ENDTRY.
    ENDFORM.
    Regards
      Uwe

Maybe you are looking for