2020年12月22日星期二

How to send/receive emails in vb.net using the Outlook Library

I'm having a problem trying to use the Microsoft Outlook library to send and receive emails through outlook via VB.net. I tried following the microsoft website page, but it didn't help at all as the I am having a problem trying to call the library in the first place. I have went into dependencies and added the following COM's Microsoft Outlook 16.0 Object Library and Microsoft Outlook View Control. but am unsure if I need to reference them in my code somewhere or not, and I'm not sure what the command would even be, up until now all I have is this:Code

Imports System  Imports System.IO      Module Program      Sub main()          Dim objOL = New Outlook.Application          Dim objNS = objOL.GetNamespace("MAPI")          Dim objFolder = objNS.GetDefaultFolder(10)          Dim Newtask As Outlook.TaskItem          ' Set the Application object           Dim objOLApps = New Outlook.Application          ' You can only use CreateItem for default items           Dim NewTasks = objOL.CreateItem(6)          ' Display the new task form so the user can fill it out           Newtask.Display()      End Sub  End Module  
https://stackoverflow.com/questions/65412215/how-to-send-receive-emails-in-vb-net-using-the-outlook-library December 23, 2020 at 12:21AM

没有评论:

发表评论