Save Message as Mime problem

I would like to save the current message as Mime from within code.
I have tried using the ItemSaveMessage() Token, but keep getting an invalid parameter error.
Do you have any ideas on what could be causing this, I have tried many different ways and still get this same error.
Here is my code:
object oAccount = state.CurrentAccount;
GroupwareTypeLibrary.Account8 account;
if (!(oAccount == null))
account = ((GroupwareTypeLibrary.Account8)(oAccount));
int stCount = account.SentItems.Messages.Count;
message = (GroupwareTypeLibrary.Message3)account.SentItems.M essages.Item(stCount);
GroupWiseCommander.GWCommander cmd = new GroupWiseCommander.GWCommanderClass();
string strRes = "";
string command = "ItemSaveMessage(" + '"' + message.MessageID + '"' + ',' + '"' + "C:\\" + '"' + ',' + '"' + "Mime" + '"' + ")";
cmd.Execute(command, out strRes);

Hi,
I also trying the same against GroupWise 7 client. I got the same error and then I made some changes to the command as below:
ItemSaveMessage("4A76C845.*";"C:\gw.eml";900)
Please note that the 1st parameter should be a proper message ID. I guess you can also use 00 to save the current message.
The MIME get saved to the file location I have specified, but the content of the file is not valid (it is corrupted).
Can somebody help me to resolve this issue?
Thanks,
Hilmi.
Originally Posted by CandiceS
I would like to save the current message as Mime from within code.
I have tried using the ItemSaveMessage() Token, but keep getting an invalid parameter error.
Do you have any ideas on what could be causing this, I have tried many different ways and still get this same error.
Here is my code:
object oAccount = state.CurrentAccount;
GroupwareTypeLibrary.Account8 account;
if (!(oAccount == null))
account = ((GroupwareTypeLibrary.Account8)(oAccount));
int stCount = account.SentItems.Messages.Count;
message = (GroupwareTypeLibrary.Message3)account.SentItems.M essages.Item(stCount);
GroupWiseCommander.GWCommander cmd = new GroupWiseCommander.GWCommanderClass();
string strRes = "";
string command = "ItemSaveMessage(" + '"' + message.MessageID + '"' + ',' + '"' + "C:\\" + '"' + ',' + '"' + "Mime" + '"' + ")";
cmd.Execute(command, out strRes);

Similar Messages

  • SOAP Message Attachment MIME Problem

    Hi there,
    I'm having problem trying to send a binary file with SOAP.
    I can send an XML Doc (MIME type text/xml) but when I try to put the ByteArrayInputStream that holds the binary file and the content to application/octec-stream
    I got this exception:
    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/octet-stream
         at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:851)
         at javax.activation.DataHandler.writeTo(DataHandler.java:305)
         at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1089)
         at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:635)
         at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233)
         at com.sun.xml.messaging.soap.MessageImpl.saveChanges(MessageImpl.java:371)
    Anyone had this problem ?
    Any work around ?
    Or this is a problem because the JAXM is not fineshed yet ?
    Thanks,
    Marcio

    Hey guys... I pray you are all still listening.
    I have been on the most mind numbing cookie trail ever (I'm blatantly lying - I'm a Java programmer!) following these blasted exception trails to an 'Unknown Source'
    After initially reading this thread I quickly knocked up ObjectDataSource as follows:
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.io.OutputStream;
    import java.io.Serializable;
    import javax.activation.DataSource;
    public class ObjectDataSource
    implements DataSource
         public static final long serialVersionUID;
         public static final String CONTENT_TYPE;
         static {
              serialVersionUID = 42L;
              CONTENT_TYPE = "application/x-java-serialized-object";
         } // end static initializer
         private byte[] objectBytes;
         private String contentId;
         public ObjectDataSource(Serializable object, String contentId)
         throws IOException
              if (contentId == null || contentId.equals(""))
                   this.contentId = object.getClass().getName();
              else
                   this.contentId = contentId;
              ByteArrayOutputStream baoStream = new ByteArrayOutputStream();
              ObjectOutputStream ooStream = new ObjectOutputStream(baoStream);
              ooStream.writeObject(object);
              ooStream.flush();
              ooStream.close();
              objectBytes = baoStream.toByteArray();
         } // end primary constructor
         public InputStream getInputStream()
         throws java.io.IOException
              ByteArrayInputStream baiStream = new ByteArrayInputStream(objectBytes);
              return new ObjectInputStream(baiStream);
         } // end getInputStream
         public OutputStream getOutputStream()
         throws java.io.IOException
              throw new IOException("Cannot write to this stream");
         } // end getOutputStream
         public String getContentType()
              return CONTENT_TYPE;
         } // end getContentType
         public String getName()
              return contentId;
         } // end getName
    } // end ObjectDataSource classand use it as follows:
    AttachmentPart attachment = soapResponse.createAttachmentPart();
    ObjectDataSource ods = new ObjectDataSource(requestedObject, null);
    attachment.setDataHandler(new DataHandler(ods));
    attachment.setContentId(ods.getName());
    soapResponse.addAttachmentPart(attachment);
    soapResponse.saveChanges();... this is within my 'SOAPServlet extends JAXMServlet' servlet, which happens to work fine when testing the servlet outside a web-container. But testing with Tomcat 5.5.x It doesn't work... infact, it damn well dissappears. I try readObject after retrieving and casting the InputStream to an ObjectInputStream from the AttachmentPart, but I get a:
    Exception in thread "main" java.lang.ClassCastException: java.io.ByteArrayInputStream which is totally bizzare!
    So I do a bit of investigation to discover ....
    application/x-java-serialized-object
    java.lang.String
    javax.mail.internet.MimePartDataSource
    java.io.ByteArrayInputStream
    0 // this would be the available bytes in the ByteArrayInputStreamNow the first two lines confirm my ObjectDataSource is there somewhere or that that data was sent over the wire (ha, i'm on the same damn machine), but where the hell did MimePartDataSource come from?
    I have previously encountered the various exceptions including java.io.EOFException when trying to read from the byte stream and java.io.StreamCorruptedException when wrapping that byte stream with an object stream.
    These setbacks have royally ****ed my project; cahnces are slim that it will get finished. I'm ready to give up.
    Any help will be appreciated?
    Warm regards,
    Darren B

  • Itunes will no longer work on my Windows 8 PC. When I attempt to start the program a message says: A problem caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available.

    Itunes will no longer work on my Windows 8 PC. When I attempt to start the program a message says: A problem caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available.  I have tried to uninstall iTunes but the Windows uninstaller will not delete the program I get a message that says: A network error occurred while attempting to read file: C:\Windows|Installer|iTunes.msi.  How do I get iTunes to work again?

    Whentrying to uninstall iTunes (the first program that must be uninstalled per the instructions) I get a message:  A network error occurred while attempting to read file: C:\Windows|Installer|iTunes.msi. I can't even uninstall iTunes?
    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page).
    http://majorgeeks.com/download.php?det=4459
    Here's a screenshot showing the particular links on the page that you should be clicking:
    After clicking one of the circled links, you should be taken to another page, and after a few seconds you should see a download dialog appear for the msicuu2.exe file. Here's a screenshot of what it looks like for me in Firefox:
    Choose to Save the file. If the dialog box does not appear for you, click the link on the page that says "CLICK HERE IF IT DOES NOT". Here's a screenshot of the page with the relevant link circled:
    When the dialog appears, choose to save the file.
    (2) Go to the Downloads area for your Web browser. Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Hi, I was working on a PDF writing comments using Adobe Reader on a Mac.  I clicked save and got a 'cannot save' message.  I then clicked save as instead, Reader froze and my PDF disappeared.  The only version saved has only my first comment.  Does Adobe

    Hi, I was working on a PDF writing comments using Adobe Reader on a Mac.  I clicked save and got a 'cannot save' message.  I then clicked save as instead, Reader froze and my PDF disappeared.  The only version saved has only my first comment.  Does Adobe Reader save to temporary files that I can access in order to recover my work?  Is there any other way to recover it?  Thanks!

    Hi @Pat Willener,
    since I got the same problem as pdfprincess I hope you can help me. The 'Automatically save document changes to temporary file...' is enabled in my adobe reader.
    A file I worked (commented) on a lot crashed. When I reopened the file, adobe reader didn't ask if I want to restore my changes in this file, as it is written on the help.adobe.com page. Is there any possibility to restore the changes manually from the temporary file?
    Thanks in advance - it is really important for me to restore these changes!!

  • Mozilla Thunderbird hangs all the time, won't download messages, won't save messages,

    Hi,
    I have been running Mozilla Thunderbird since the beginning of the year.
    I have always had problems, but it seems to be getting worse.
    It won't download messages, it won't save messages at the time you send them, instead a window runs for ages saying:
    "Copying messages to saved folder"
    Then it says
    "There was an error saving the message to sent, retry?"
    You hit cancel and then it comes up with:
    "The message was sent successfully, but could not be copied to your Sent folder. Would you like to return to the compose window?"
    Then there is the problem of downloading messages, basically it doesn't all the time, it hangs and I have to either restart the computer or download them on my iphone.
    It can take upwards of 20 minutes to download a single message.
    I had a look at the "Activity Manager" and it seems frozen as well.
    It also sends up the messages that the server has been disconnected or timed out.
    I've had a look through the trouble shooting guide but can't seem to progress this.
    Any suggestions will be greatly appreciated!
    I am running the latest version, and have Windows 7, 64 bit.
    I am fast of the opinion I'd better shell out some cash and get Windows Outlook as Thunderfox is a nightmare.
    Many thanks,
    Adrian

    Thunderbird support is over here. <br />
    http://www.mozillamessaging.com/en-US/support/ <br />
    or here: <br />
    http://forums.mozillazine.org/viewforum.php?f=39

  • Won't save message as Draft

    Mail won't save messages as Draft
    just says message cannot be saved.
    Same after reboot.
    In fact I am also getting an error message when composing emails "message cannot be saved"
    any suggestions please
    thanks
    Pete

    Hi Peter,
    Not certain, but this can fix myriad Mail problems...
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these folder & file to the Desktop.
    Move this Folder to the Desktop...
    /Users/YourUserName/Library/Caches/Mail/
    Move this file to the Desktop...
    /Users/YourUserName/Library/Mail/Envelope Index
    Reboot.

  • I'm running iCloud on a Windows 7 PC. Photoes have been autmatically uploaded from my iPhone. However, the "Photoes" ICON does not load, and I receive an error message of a problem. Then the ICON disappears. How can I access my photoes?

    I'm running iCloud on a Windows 7 PC. Photoes have been autmatically uploaded from my iPhone. However, the "Photoes" ICON does not load, and I receive an error message of a problem. Then the ICON disappears. How can I access my photoes?

    Same issue here,  previously did work perfectly

  • I want to go back to the previous 2014.2 version.  .3 is much too buggy and full of error messages. Creating problems as I am on a timeline with my client and I don't have time to fool around with all the problems.

    2014 .3 is much too buggy and full of error messages. Creating problems as I am on a timeline with my client and I don't have time to fool around with all the problems.

    You didn't mention what error(s) you've encountered? A workaround for the most commonly hit problem is here Re: error in Muse : Object UID:U6875 has two (or more) owners: U3633 and U3165
    If you have a copy of your .muse file that has not been saved using 2014.3, you can downgrade by uninstalling Muse and then choose Previous Version in the Filters drop down in the Apps panel of the Creative Cloud desktop app. There will be a popup next to Muse where you can select a prior version to install.

  • I can no longer type messages.  I have tried deleting to see if I have too many saves messages.  That did not help.  I also cut off the phone and turned back on.  That did not help.  Ideas?

    I can no longer type messages.  I have tried deleting to see if I have too many saves messages.  That did not help.  I also cut off the phone and turned back on.  That did not help.  Ideas?

    http://www.bubblews.com/news/874646-apple-is-having-issues

  • My Itunes program has stopped working. Message:An onknown problem has occurred (-42032) - what can I do? Björn

    Hi
    My Itunes program goes down - tried to reeinstall but I does not help. I get the message: An unknown problem has occurred (-42031)
    What can I do?
    Björn

    If your iTunes is up to date, remove the SC Info folder.

  • My itunes wount open when i try to open it this message comes up Problem signature:   Problem Event Name:     BEX   Application Name:     iTunes.exe   Application Version:     10.6.3.25   Application Timestamp:     4fd16377   Fault Module Name:     CRYPTU

    when i try to open my Itunes this Message comes up
    Problem signature:
      Problem Event Name:    BEX
      Application Name:    iTunes.exe
      Application Version:    10.6.3.25
      Application Timestamp:    4fd16377
      Fault Module Name:    CRYPTUI.dll_unloaded
      Fault Module Version:    0.0.0.0
      Fault Module Timestamp:    4ce7b847
      Exception Offset:    68221040
      Exception Code:    c0000005
      Exception Data:    00000008
      OS Version:    6.1.7601.2.1.0.768.3
      Locale ID:    5129
      Additional Information 1:    0a9e
      Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:    0a9e
      Additional Information 4:    0a9e372d3b4ad19135b953a78882e789
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt

    Taken at face value, you're having trouble with a Windows operating system file there.
    Perhaps try an sfc /scannow. For instructions, see the following Microsoft document:
    How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7

  • HT201210 Having trouble restoring my ipod touch 4 gen. When i click restore i get an error message saying that " problem downloading software for the "ipod owner's ipod"

    When i try to restore my ipod i recieve an error message saying that "problem downloading softwar  for the ipod owner's ipod. error (-23) Please help i need to restore because my daughter somehow set a passcode lock on it and didnt know it and does not know passcode.

    There was a problem downloading the software for the iPhone (or another iOS device)
    See the steps below for error codes 3000-3999.
    Errors 3000-3999 (3004, 3013, 3014, 3018, 3164, 3194, and so on): Error codes in the 3000 range generally mean that iTunes cannot contact the update server (gs.apple.com) on ports 80 or 443.
    Update to the latest version of iTunes.
    Verify the computer's date and time are accurate.
    Check that your security or firewall software is not interfering with ports 80 or 443, or with the server gs.apple.com.
    Follow Troubleshooting security software. Often, uninstalling third-party security software will resolve these errors.
    An entry in your hosts file may be redirecting requests to gs.apple.com (see "Unable to contact the iOS software update server gs.apple.com" above).
    Internet proxy settings can cause this issue. If you are using a proxy, try without using one.
    Test restoring while connected to a known-good network.

  • Got a new iPhone today and tried to restore from my old phone using icloud but kept coming up with a message that said problem with my icloud back up please help

    Got a new iPhone today and tried to restore from my old phone using icloud but kept coming up with a message that said problem with my icloud back up please help

    Hi there Clairemcaula,
    You may find the troubleshooting steps in the article below helpful.
    iCloud: Troubleshooting restoring an iCloud backup
    http://support.apple.com/kb/ts4036
    -Griff W. 

  • Adobe Digital Ed 4.0 will not open -- gets a Microsoft error message "encountered a problem and needs to close"

    Does not open.
    Instead Microsoft error message "encounters a problem and needs to close".
    I have already tried the uninstall & reinstall "solution".
    What else can I do.  I have a paid for document I would like to read.
    Thanks.

    Hi ynotcookit
    Please make sure that antivirus has been disabled...
    Check the .net framework installed on the machine and update it, if required
    Also, Let us know the exact OS that you're using?
    Thanks,
    Mandeep

  • AppleScript To Save Messages As PDFs With Specific Naming Convention

    I am looking for an Applescript that:
    1: Prompts and allows the user to select one or more Apple Mail email messages from within Mail (10.4, 10.5, 10.6).
    2: Prompts and allows the user to select a save-to folder.
    3: For each message, saves it as a PDF file in the save-to folder, using the following naming convention for the PDF file:
    "YYYY-MM-DD HH.MM.SS Email From FIRSTNAME LASTNAME - SUBJECT",
    "YYYY-MM-DD HH.MM.SS Email To FIRSTNAME LASTNAME - SUBJECT",
    where in the email date-sent stamp (if I am the sender) or date-received stamp (if I am the recipient):
    YYYY = the year
    MM = the two-digit month
    DD = the two-digit day
    HH = the two-digit hour (in 24-hour time)
    MM = the two-digit minute
    SS = the two-digit second
    FIRSTNAME is the email sender's first name for email that I receive (or is the email recipient's first name for email that I send)
    LASTNAME is the email sender's last name for email that I receive (or is the email recipient's first name for email that I send)
    SUBJECT = the email's subject line
    For example: 2010-04-10 16.32.48 Email From Kris Ryan - Status Of Payroll Updates.pdf
    For example: 2010-04-10 16.33.55 Email To Sue Anderson - RE Status Of Payroll Updates.pdf (Colon omitted after "RE".)
    4: For each attachment to the message, saves it as a PDF file in the same directory using the naming convention:
    "YYYY-MM-DD HH.MM.SS Email From FIRSTNAME LASTNAME Z Attachment - NUMBER - FILENAME",
    where:
    YYYY-MM-DD HH.MM.SS Email From FIRSTNAME LASTNAME = as above
    NUMBER = an integer representing the attachment number (1, 2, ...) sorted according to filename alphabetical order
    FILENAME = the name of the file attached to the email, including its extension (.docx, .xlsx, etc.)
    The letter "Z" sorts the attachment PDFs after its respective parent email in the directory.
    For example: 2010-04-10 16.32.48 Email From Kris Ryan Z Attachment - 1 - List Of Suggestions To Moore.doc.pdf
    For example: 2010-04-10 16.32.48 Email From Kris Ryan Z Attachment - 2 - Proposed Salary Adjustments.xls.pdf
    For example: 2010-04-10 16.32.48 Email From Kris Ryan Z Attachment - 3 - Salary History.pps.pdf
    Note: The email attachment may consist of a PDF or MS Office file (Word, Excel, Power Point); however, a smart implementation will be able to handle any attachment kind. If the attachment is a PDF file, then save it "as is" using the stipulated naming convention, without passing it through Distiller.
    Thank you.
    Kurt Todoroff

    Well, that's quite a spec sheet.
    Here's a start, you can easily edit the script to get what you need:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #E6E6EE;
    overflow: auto;"
    title="this text can be pasted into the AppleScript Editor">
    Set a Mail Rule to Save Message and Attachment to Desktop.
    To save attachments to another another folder on the desktop (i.e. Attachments) create the folder and then
    change tell application "Finder" to set pathToAttachments to (path to desktop folder as string) & "Attachments:"
    using terms from application "Mail"
    on perform mail action with messages theMessages
    tell application "Finder" to set ptd to (path to desktop folder) as string
    tell application "Finder" to set pathToAttachments to (path to desktop folder) as string
    tell application "Mail"
    repeat with theMessage in theMessages
    set d_recd to date received of theMessage as string
    set d_recd to ReplaceText(d_recd, ":", " ") of me
    set d_recd to ReplaceText(d_recd, ",", " ") of me
    set theText to content of theMessage
    if theMessage's mail attachments is not {} then
    repeat with theAttachment in theMessage's mail attachments
    set theFileName to pathToAttachments & (theMessage's subject) & " (Attachment From " & (theMessage's sender) & " Sent " & d_recd & ")" & space & theAttachment's name
    try
    save theAttachment in theFileName
    on error errnum
    end try
    end repeat
    end if
    set theFile to ptd & (theMessage's subject) & " (From " & (theMessage's sender) & " Sent " & d_recd & ")" & ".txt"
    set theFileID to open for access file theFile with write permission
    write theText to theFileID
    close access theFileID
    end repeat
    end tell
    end perform mail action with messages
    end using terms from
    on ReplaceText(theString, fString, rString)
    set current_Delimiters to text item delimiters of AppleScript
    set AppleScript's text item delimiters to fString
    set sList to every text item of theString
    set AppleScript's text item delimiters to rString
    set newString to sList as string
    set AppleScript's text item delimiters to current_Delimiters
    return newString
    end ReplaceText</pre>

Maybe you are looking for