Author |
|
KevinRussell Newbie
Joined: 29 November 2016 Location: United Kingdom
Online Status: Offline Posts: 2
|
Posted: 29 November 2016 at 3:43am | IP Logged
|
|
|
Chaps
Is it possible to send emails and parse the inbox of an Office365 Outlook Email account using Mailbee Objects (not .net).
If have searched the forums without success but feel free to point me in the right direction!
Regards
Kevin Russell
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 29 November 2016 at 5:21am | IP Logged
|
|
|
Hi,
You can use it just as any other IMAP or SMTP service. For instance, IMAP (getting folder count, inbox message count, downloading last message):
Code:
Set IMAP = CreateObject("MailBee.IMAP4")
IMAP.LogFilePath = "C:\Temp\imap_log.txt"
IMAP.EnableLogging = True
IMAP.ClearLog
IMAP.LicenseKey = "your key"
IMAP.SSL.Enabled = True
IMAP.SSL.Protocol = 6 ' TLS 1.2
IMAP.Connect "outlook.office365.com", 993, "user@officedomain", "password"
Set Mboxes = IMAP.RetrieveMailboxes(false)
MsgBox MBoxes.Count
IMAP.SelectMailbox "Inbox"
MsgBox IMAP.MessageCount
Set Msg = IMAP.RetrieveSingleMessage(IMAP.MessageCount, False)
MsgBox Msg.Subject
IMAP.Disconnect
|
|
|
SMTP (sending mail to yourself):
Code:
Set SMTP = CreateObject("MailBee.SMTP")
SMTP.EnableLogging = True
SMTP.LogFilePath = "C:\Temp\smtp_log.txt"
SMTP.ClearLog
SMTP.LicenseKey = "your key"
SMTP.ServerName = "smtp.office365.com"
SMTP.SSL.Enabled = True
SMTP.SSL.UseStartTLS = True
SMTP.SSL.Protocol = 6 ' TLS 1.2
SMTP.PortNumber = 587
SMTP.AuthMethod = 2
SMTP.UserName = "user@officedomain"
SMTP.Password = "password"
SMTP.FromAddr = "user@officedomain"
SMTP.ToAddr = "user@officedomain"
SMTP.Message.Subject = "test"
SMTP.Send
|
|
|
Regards,
Alex
|
Back to Top |
|
|
KevinRussell Newbie
Joined: 29 November 2016 Location: United Kingdom
Online Status: Offline Posts: 2
|
Posted: 29 November 2016 at 7:56am | IP Logged
|
|
|
Alex
Worked like a charm - thanks.
Kevin Russell
|
Back to Top |
|
|