Search The ForumSearch   RegisterRegister  LoginLogin

MailBee IMAP4

 AfterLogic Forum : MailBee IMAP4
Subject Topic: how to sent mail to outbox. Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
arpan8384
Newbie
Newbie


Joined: 23 April 2007
Location: India
Online Status: Offline
Posts: 3
Posted: 23 April 2007 at 4:53am | IP Logged Quote arpan8384

I am using mail bee successfully.

how do i keep trak of sent mail using imap4?
i would like to save sent mail in the outbox?
Back to Top View arpan8384's Profile Search for other posts by arpan8384
 
oleg
AfterLogic Support
AfterLogic Support
Avatar

Joined: 11 April 2007
Location: United States
Online Status: Offline
Posts: 21
Posted: 23 April 2007 at 6:12am | IP Logged Quote oleg

Messages are not stored into Sent folder automatically during sending
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 View oleg's Profile Search for other posts by oleg Visit oleg's Homepage
 
arpan8384
Newbie
Newbie


Joined: 23 April 2007
Location: India
Online Status: Offline
Posts: 3
Posted: 23 April 2007 at 10:38pm | IP Logged Quote arpan8384

I am new to mailbee so please.
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 View arpan8384's Profile Search for other posts by arpan8384
 
oleg
AfterLogic Support
AfterLogic Support
Avatar

Joined: 11 April 2007
Location: United States
Online Status: Offline
Posts: 21
Posted: 24 April 2007 at 2:54am | IP Logged Quote oleg

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:

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 View oleg's Profile Search for other posts by oleg Visit oleg's Homepage
 
arpan8384
Newbie
Newbie


Joined: 23 April 2007
Location: India
Online Status: Offline
Posts: 3
Posted: 24 April 2007 at 10:20pm | IP Logged Quote arpan8384

It works successfully.
Thank You.
Back to Top View arpan8384's Profile Search for other posts by arpan8384
 
venesh_b
Newbie
Newbie
Avatar

Joined: 25 June 2007
Location: India
Online Status: Offline
Posts: 1
Posted: 25 June 2007 at 12:25am | IP Logged Quote venesh_b

How to retrieve fields from mail.eml file to display when the sent folder is selected
Back to Top View venesh_b's Profile Search for other posts by venesh_b
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 25 June 2007 at 12:51am | IP Logged Quote Andrew

If you mean mail.eml stored on file system, you may load it and display necessary fields as follows (VB6 syntax):

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 View Andrew's Profile Search for other posts by Andrew
 
nagendrasimha
Newbie
Newbie


Joined: 20 March 2009
Location: India
Online Status: Offline
Posts: 3
Posted: 23 March 2009 at 3:39am | IP Logged Quote nagendrasimha

Hi there

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 View nagendrasimha's Profile Search for other posts by nagendrasimha
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 23 March 2009 at 5:33am | IP Logged Quote Andrew

Please try to retrieve all mailboxes available in that account and display their names. Is there "Sent" folder?

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
canada87
Newbie
Newbie
Avatar

Joined: 31 May 2011
Location: United States
Online Status: Offline
Posts: 1
Posted: 08 June 2011 at 7:21am | IP Logged Quote canada87

Andrew,

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 View canada87's Profile Search for other posts by canada87 Visit canada87's Homepage
 
Cranky-9
Newbie
Newbie


Joined: 05 September 2011
Location: United States
Online Status: Offline
Posts: 1
Posted: 05 September 2011 at 6:27am | IP Logged Quote Cranky-9

Oh thanks for the script. My problem is already fixed. It works perfectly now:)
Back to Top View Cranky-9's Profile Search for other posts by Cranky-9 Visit Cranky-9's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide