HI,
 
I am trying to use following sample code to silently add email to versmail v3.0 on treo 650. SysAppLaunch returns no error. but, when I check versamail client it does not contain any new email.
 
Does anybody have experience with adding email to versamail using following sample code to use VersaMail plugin?
 
 /* SubLaunch silently adds email to versmail */
   else if (eventP->data.ctlSelect.controlID == MainLaunchButton)
   {
    MailAddRecordParamsTypePlus mailPlus;
    MailAddRecordAttachment attchmnt;
    
    attchmnt.attachType = "text/plain";
    attchmnt.attachDescription = "Text Attachment";
    
    /* Extension is important the plugin viewer is selected
     * using this.
     */
    attchmnt.attachFileName = "TextFile.txt";
    attchmnt.data.attachData = "Hmmm this is a test attachment";
    attchmnt.attachSize = StrLen( attchmnt.data.attachData ) + 1;

    
    mailPlus.category = 2; /* Add the msg to Drafts */
    mailPlus.numAttachments = 1;
    mailPlus.attachments[0] = attchmnt;
        
    
    mailPlus.mainParams.secret = false;
    mailPlus.mainParams.signature = true;
    mailPlus.mainParams.confirmRead = false;
    mailPlus.mainParams.confirmDelivery = false;
    mailPlus.mainParams.priority = mailPriorityNormal;
    mailPlus.mainParams.subject = "Hi";    
    mailPlus.mainParams.from = NULL;/* Note from is automatically taken from the account settings */
    mailPlus.mainParams.to = "[EMAIL PROTECTED] ";
    mailPlus.mainParams.cc = NULL;
    mailPlus.mainParams.bcc = NULL;
    mailPlus.mainParams.replyTo = "[EMAIL PROTECTED] ";
    mailPlus.mainParams.body = "Test message";    
    
    
    {
     UInt16    cardNo;
     LocalID    dbID;
     DmSearchStateType searchState;
     UInt32     result;
     Err     err;

     DmGetNextDatabaseByTypeCreator(true, &searchState, sysFileTApplication,
        'asc3', true, &cardNo, &dbID);
     
     if (dbID)
     {
      err = SysAppLaunch(cardNo, dbID, 0, MMPRO_ADD_MESSAGE_WITH_ATTACHMENT, (MemPtr) &mailPlus, &result);
      
      if(err)
       FrmCustomAlert(GeneralAlert, "Error adding mail to Versmail","","");     
      else     
       FrmCustomAlert(GeneralAlert, "Mail has been added to Versmail","","");
     
     }
     else
      FrmCustomAlert(GeneralAlert, "Versmail not present","","");
      
     
    }        
    
    
    handled  = true; 
    break;

-- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to