| Author |  | 
      
        | arpan8384 Newbie
 
  
 
 Joined: 23 April 2007
 Location: India
 Online Status: Offline
 Posts: 3
 | 
          I am using mail bee successfully.
           | Posted: 23 April 2007 at 4:53am | IP Logged |   |  
           | 
 |  
 how do i keep trak of sent mail using imap4?
 i would like to save sent mail in the outbox?
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | oleg AfterLogic Support
 
  
  
 Joined: 11 April 2007
 Location: United States
 Online Status: Offline
 Posts: 21
 | 
          Messages are not stored into Sent folder automatically during sending
           | Posted: 23 April 2007 at 6:12am | IP Logged |   |  
           | 
 |  through SMTP server because SMTP protocol doesn't support it.
 
 To store messages in Sent folder, you should connect to IMAP server
 (POP3 protocol support only Inbox folder) and upload them via
 IMAP4.AppendMessage method.
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | arpan8384 Newbie
 
  
 
 Joined: 23 April 2007
 Location: India
 Online Status: Offline
 Posts: 3
 | 
          I am new to mailbee so please.
           | Posted: 23 April 2007 at 10:38pm | IP Logged |   |  
           | 
 |  Can u send me the syntax of appendmessage ?because i didn't get it from IMAP4.AppendMessage method. i have replace "Inbox" to "Outbox" string still it is giving error.
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | oleg AfterLogic Support
 
  
  
 Joined: 11 April 2007
 Location: United States
 Online Status: Offline
 Posts: 21
 | 
          Usually, Outbox folder doesn't exist on the mail server. Outbox folder in popular mailers, like MS Outlook, is just a temporary buffer messages are placed into before sending. After sending, messages are placed into Sent (or Send Items, or Sent Messages) folder. Thus, looks like you mean Sent folder, not Outbox. You into Sent folder as follows:
           | Posted: 24 April 2007 at 2:54am | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | Dim objIMAP4, objMsg
 
 ' Create IMAP4 object
 Set objIMAP4 = CreateObject("MailBee.IMAP4")
 
 ' Unlock IMAP4 object
 objIMAP4.LicenseKey = "put your license key here"
 
 objIMAP4.EnableLogging = True
 objIMAP4.LogFilePath = "imap4_log.txt"
 
 
 ' Set IMAP4 server name
 objIMAP4.ServerName = "mailserver.com"
 
 ' Set user credentials
 objIMAP4.UserName = "MyName"
 objIMAP4.Password = "MyPassword"
 
 ' Connect to the server and
 ' log in email account
 If objIMAP4.Connect Then
 
 ' Select Inbox folder
 If objIMAP4.SelectMailbox("Sent") Then
 ' All is fine
 MsgBox "Sent folder selected successfully"
 
 ' Upload message from mail.eml file keeping defaults for datetime and flags
 If objIMAP4.AppendMessage("Sent", "C:\mail.eml", , , 1) Then
 MsgBox "Message uploaded successfully"
 End If
 
 Else
 ' Display error information
 MsgBox "Error #" & objIMAP4.ErrCode
 MsgBox "Server response: " & objIMAP4.ServerResponse
 End If
 
 ' Close the connection
 objIMAP4.Disconnect
 Else
 ' Display error information
 MsgBox "Error #" & objIMAP4.ErrCode
 MsgBox "Server response: " & objIMAP4.ServerResponse
 End If
 
 |  |  |  
 Please make sure Sent folder exists on the IMAP server, otherwise, you should create it first via CreateMailbox method.
 
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | arpan8384 Newbie
 
  
 
 Joined: 23 April 2007
 Location: India
 Online Status: Offline
 Posts: 3
 | 
          It works successfully.
           | Posted: 24 April 2007 at 10:20pm | IP Logged |   |  
           | 
 |  Thank You.
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | venesh_b Newbie
 
  
  
 Joined: 25 June 2007
 Location: India
 Online Status: Offline
 Posts: 1
 | 
          How to retrieve fields from mail.eml file to display when the sent folder is selected
           | Posted: 25 June 2007 at 12:25am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          If you mean mail.eml stored on file system, you may load it and display necessary fields as follows (VB6 syntax):
           | Posted: 25 June 2007 at 12:51am | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | Dim Mailer Set Mailer = CreateObject("MailBee.SMTP")
 Mailer.LicenseKey = "put your license key here"
 
 Mailer.Message.ImportFromFile "C:\docs\letter.eml"
 
 MsgBox Mailer.Message.FromAddr
 |  |  |  
 If you need to download a message from IMAP folder and display its fields, this can be done as follows (VB6 syntax):
 
 
 
| Code: 
 
    
    | 
      
       | ' This sample retrieves last message in Inbox and displays its body Dim Mailer, Message
 Set Mailer = CreateObject("MailBee.IMAP4")
 
 Mailer.EnableLogging = True
 Mailer.LogFilePath = "C:\imap4_log.txt"
 Mailer.ClearLog
 
 Mailer.LicenseKey = "put your license key here"
 
 If Mailer.Connect("mailserver.com", 143, "MyName", "MyPassword") Then
 If Mailer.SelectMailbox("Inbox") Then
 Set Message = Mailer.RetrieveSingleMessage(Mailer.MessageCount, False)
 If Not Message Is Nothing Then
 MsgBox Message.BodyText
 End If
 End If
 Mailer.Disconnect
 End If
 |  |  |  
 
 Also, the documentation contains a lot of helpful source code samples.
 
 
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | nagendrasimha Newbie
 
  
 
 Joined: 20 March 2009
 Location: India
 Online Status: Offline
 Posts: 3
 | 
          Hi there
           | Posted: 23 March 2009 at 3:39am | IP Logged |   |  
           | 
 |  
 I tried to use the above mentioned code to select "Sent" Inbox for Lotus Notes 8.0, but got the following response
 
 Error #312
 Server Response: MBC000002 NO SELECT failure, cannot select mailbox: Folder not found in IMAP namespace
 
 Any ideas why is this happening?
 
 Regards
 Nagendra
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          Please try to retrieve all mailboxes available in that account and display their names. Is there "Sent" folder?
           | Posted: 23 March 2009 at 5:33am | IP Logged |   |  
           | 
 |  
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | canada87 Newbie
 
  
  
 Joined: 31 May 2011
 Location: United States
 Online Status: Offline
 Posts: 1
 | 
          Andrew,
           | Posted: 08 June 2011 at 7:21am | IP Logged |   |  
           | 
 |  
 Thanks a ton. It was a big help. I didn't realize messages weren't automatically stored in the sent folder so that helped clarify.
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | Cranky-9 Newbie
 
  
 
 Joined: 05 September 2011
 Location: United States
 Online Status: Offline
 Posts: 1
 | 
          Oh thanks for the script. My problem is already fixed. It works perfectly now:)
           | Posted: 05 September 2011 at 6:27am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  |