I have been able to save MS Outlook email attachments by using MS Access VBA. This has been achieved on a client side.
On the server side, I will need to create something similar (either in SQL Server or SSIS). I have researched into this and found third party controls. I think I also found some C# code that did it too.
The tricky part is on client side, the VBA automatically uses my email account. How would I use a different email account to log into MS Outlook and save the attachment on server side?
If you get to the point you need to install Outlook on a server, you're doing it wrong. You need to look into getting the email directly from your Exchange server, authenticating with whatever credentials make sense for what you want to access.
Hi Yosiasz, I have not tried with another user account yet but will let you know and update this thread once I attempt to do so.
Hi Andyc, I agree that installation of Office on the server is probably not the best method. But we don't have an Exchange Server since we are on Office 365.
Hi Andy, can you provide a link or example? Maybe we are talking about the samething. Here is my VBA automation code to initialize to MS Outlook:
Dim mfInbox As MAPIFolder
'B---------------- ***** Initialize and Connect to the MS Outlook Inbox 2018_08_03(10:56 AM) ***** ----------------B
Dim oNS As Outlook.Namespace
Set oNS = GetNamespace("MAPI")
Set mfInbox = oNS.GetDefaultFolder(olFolderInbox)
If mfInbox.Items.Count = 0 Then
MsgBox "There are no messages in the Inbox.", vbInformation, "Nothing Found"
Exit Sub
End If
'E---------------- ***** Initialize and Connect to the MS Outlook Inbox 2018_08_03(10:56 AM) ***** ----------------E
If I go this route, then I still would need to install the bare minimum Office drivers to the server. I have not tried to use another account yet to run this code but when running locally, it works. Is this the same IMAP that you are referring to?
listen to bitsmed...on everything he posts.
EWS is super nice but a bit bloated in the sense that it gives you EVERYTHING. A bit too much but that is what I use and works amazingly
No, IMAP is a method for talking directly to an email server by acting as a mail client. It's a fairly common and straightforward protocol and you can probably find a helper library for whatever language you're using. A big advantage to IMAP over just about anything else is that it's pretty much supported by every mail server going, so you aren't tied to an Exchange (or O365) based solution.