Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
' *********************************************************************** ' Author : Elektro ' Modified : 12-December-2017 ' *********************************************************************** #Region " Public Members Summary " #Region " Methods " ' SendOutlookText(String, String, String, String, String) ' SendOutlookText(String, String, String, String, String, Attachment()) ' SendOutlookText(String, String, String, String, String, Collection(Of Attachment)) ' SendOutlookText(String, String, String, String, MailAddress) ' SendOutlookText(String, String, String, String, MailAddress, Attachment()) ' SendOutlookText(String, String, String, String, MailAddress, Collection(Of Attachment)) ' SendOutlookText(String, String, String, String, String()) ' SendOutlookText(String, String, String, String, String(), Attachment()) ' SendOutlookText(String, String, String, String, String(), Collection(Of Attachment)) ' SendOutlookText(String, String, String, String, MailAddressCollection) ' SendOutlookText(String, String, String, String, MailAddressCollection, Attachment()) ' SendOutlookText(String, String, String, String, MailAddressCollection, Collection(Of Attachment)) ' SendOutlookText(NetworkCredential, String, String, String) ' SendOutlookText(NetworkCredential, String, String, String, Attachment()) ' SendOutlookText(NetworkCredential, String, String, String, Collection(Of Attachment)) ' SendOutlookText(NetworkCredential, String, String, MailAddress) ' SendOutlookText(NetworkCredential, String, String, MailAddress, Attachment()) ' SendOutlookText(NetworkCredential, String, String, MailAddress, Collection(Of Attachment)) ' SendOutlookText(NetworkCredential, String, String, String()) ' SendOutlookText(NetworkCredential, String, String, String(), Attachment()) ' SendOutlookText(NetworkCredential, String, String, String(), Collection(Of Attachment)) ' SendOutlookText(NetworkCredential, String, String, MailAddressCollection) ' SendOutlookText(NetworkCredential, String, String, MailAddressCollection, Attachment()) ' SendOutlookText(NetworkCredential, String, String, MailAddressCollection, Collection(Of Attachment)) ' SendOutlookHtml(String, String, String, String, String) ' SendOutlookHtml(String, String, String, String, String, Attachment()) ' SendOutlookHtml(String, String, String, String, String, Collection(Of Attachment)) ' SendOutlookHtml(String, String, String, String, MailAddress) ' SendOutlookHtml(String, String, String, String, MailAddress, Attachment()) ' SendOutlookHtml(String, String, String, String, MailAddress, Collection(Of Attachment)) ' SendOutlookHtml(String, String, String, String, String()) ' SendOutlookHtml(String, String, String, String, String(), Attachment()) ' SendOutlookHtml(String, String, String, String, String(), Collection(Of Attachment)) ' SendOutlookHtml(String, String, String, String, MailAddressCollection) ' SendOutlookHtml(String, String, String, String, MailAddressCollection, Attachment()) ' SendOutlookHtml(String, String, String, String, MailAddressCollection, Collection(Of Attachment)) ' SendOutlookHtml(NetworkCredential, String, String, String) ' SendOutlookHtml(NetworkCredential, String, String, String, Attachment()) ' SendOutlookHtml(NetworkCredential, String, String, String, Collection(Of Attachment)) ' SendOutlookHtml(NetworkCredential, String, String, MailAddress) ' SendOutlookHtml(NetworkCredential, String, String, MailAddress, Attachment()) ' SendOutlookHtml(NetworkCredential, String, String, MailAddress, Collection(Of Attachment)) ' SendOutlookHtml(NetworkCredential, String, String, String()) ' SendOutlookHtml(NetworkCredential, String, String, String(), Attachment()) ' SendOutlookHtml(NetworkCredential, String, String, String(), Collection(Of Attachment)) ' SendOutlookHtml(NetworkCredential, String, String, MailAddressCollection) ' SendOutlookHtml(NetworkCredential, String, String, MailAddressCollection, Attachment()) ' SendOutlookHtml(NetworkCredential, String, String, MailAddressCollection, Collection(Of Attachment)) #End Region #Region " Functions " ' SendOutlookAsyncText(String, String, String, String, String) As Task ' SendOutlookAsyncText(String, String, String, String, String Attachment()) As Task ' SendOutlookAsyncText(String, String, String, String, String, Collection(Of Attachment)) As Task ' SendOutlookAsyncText(String, String, String, String, MailAddress) As Task ' SendOutlookAsyncText(String, String, String, String, MailAddress Attachment()) As Task ' SendOutlookAsyncText(String, String, String, String, MailAddress, Collection(Of Attachment)) As Task ' SendOutlookAsyncText(String, String, String, String, String()) As Task ' SendOutlookAsyncText(String, String, String, String, String() Attachment()) As Task ' SendOutlookAsyncText(String, String, String, String, String(), Collection(Of Attachment)) As Task ' SendOutlookAsyncText(String, String, String, String, MailAddressCollection) As Task ' SendOutlookAsyncText(String, String, String, String, MailAddressCollection Attachment()) As Task ' SendOutlookAsyncText(String, String, String, String, MailAddressCollection, Collection(Of Attachment)) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, String) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, String Attachment()) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, String, Collection(Of Attachment)) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, MailAddress) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, MailAddress Attachment()) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, MailAddress, Collection(Of Attachment)) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, String()) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, String() Attachment()) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, String(), Collection(Of Attachment)) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, MailAddressCollection) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, MailAddressCollection Attachment()) As Task ' SendOutlookAsyncText(NetworkCredential, String, String, MailAddressCollection, Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(String, String, String, String, String) As Task ' SendOutlookAsyncHtml(String, String, String, String, String Attachment()) As Task ' SendOutlookAsyncHtml(String, String, String, String, String, Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(String, String, String, String, MailAddress) As Task ' SendOutlookAsyncHtml(String, String, String, String, MailAddress Attachment()) As Task ' SendOutlookAsyncHtml(String, String, String, String, MailAddress, Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(String, String, String, String, String()) As Task ' SendOutlookAsyncHtml(String, String, String, String, String() Attachment()) As Task ' SendOutlookAsyncHtml(String, String, String, String, String(), Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(String, String, String, String, MailAddressCollection) As Task ' SendOutlookAsyncHtml(String, String, String, String, MailAddressCollection Attachment()) As Task ' SendOutlookAsyncHtml(String, String, String, String, MailAddressCollection, Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, String) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, String Attachment()) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, String, Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, MailAddress) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, MailAddress Attachment()) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, MailAddress, Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, String()) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, String() Attachment()) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, String(), Collection(Of Attachment)) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, MailAddressCollection) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, MailAddressCollection Attachment()) As Task ' SendOutlookAsyncHtml(NetworkCredential, String, String, MailAddressCollection, Collection(Of Attachment)) As Task #End Region #End Region #Region " Option Statements " Option Strict On Option Explicit On Option Infer Off #End Region #Region " Imports " Imports System.Collections.ObjectModel Imports System.Net Imports System.Net.Mail Imports System.Threading.Tasks Imports ElektroKit.Core.Types #End Region #Region " Mail Util " Namespace NET.Tools Partial Public NotInheritable Class MailUtil : Inherits AestheticObject #Region " Public Methods " #Region " Text Body " ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String) MailUtil.SendOutlookText(username, password, subject, body, {address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) MailUtil.SendOutlookText(username, password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookText(username, password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) MailUtil.SendOutlookText(username, password, subject, body, {address.Address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) MailUtil.SendOutlookText(username, password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookText(username, password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookText(username, password, subject, body, addressCollection, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookText(username, password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookText(username, password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) MailUtil.SendOutlookText(username, password, subject, body, addresses, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment MailUtil.SendOutlookText(username, password, subject, body, addresses, attachCol) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' SendOutlookText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlook(username, password, subject, body, addresses, attachments, isBodyHtml:=False) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookText(credential, "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String) MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, {address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookText(credential, "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookText(credential, "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookText(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, {address.Address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookText(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookText(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookText(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, addressCollection, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookText(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookText(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookText(credential, "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, addresses, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookText(credential, "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment MailUtil.SendOutlookText(credential.UserName, credential.Password, subject, body, addresses, attachCol) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a plain text body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' SendOutlookText(credential, "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlook(credential.UserName, credential.Password, subject, body, addresses, attachments, isBodyHtml:=False) End Sub #End Region #Region " HTML Body " ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String) MailUtil.SendOutlookHtml(username, password, subject, body, {address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) MailUtil.SendOutlookHtml(username, password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookHtml(username, password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) MailUtil.SendOutlookHtml(username, password, subject, body, {address.Address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) MailUtil.SendOutlookHtml(username, password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookHtml(username, password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookHtml(username, password, subject, body, addressCollection, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookHtml(username, password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookHtml(username, password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) MailUtil.SendOutlookHtml(username, password, subject, body, addresses, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment MailUtil.SendOutlookHtml(username, password, subject, body, addresses, attachCol) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' SendOutlookHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlook(username, password, subject, body, addresses, attachments, isBodyHtml:=True) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookHtml(credential, "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String) MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, {address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookHtml(credential, "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookHtml(credential, "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, {address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookHtml(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, {address.Address}) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookHtml(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookHtml(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookHtml(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, addressCollection, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' SendOutlookHtml(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' SendOutlookHtml(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookHtml(credential, "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, addresses, attachments:=Nothing) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' SendOutlookHtml(credential, "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment MailUtil.SendOutlookHtml(credential.UserName, credential.Password, subject, body, addresses, attachCol) End Sub ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail with a HTML body through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' SendOutlookHtml(credential, "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Sub SendOutlookHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) MailUtil.SendOutlook(credential.UserName, credential.Password, subject, body, addresses, attachments, isBodyHtml:=True) End Sub #End Region #If NET45 OrElse NET46 Then #Region " (ASYNC) Text Body " ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String) As Task Await MailUtil.SendOutlookAsyncText(username, password, subject, body, {address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncText(username, password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncText(username, password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) As Task Await MailUtil.SendOutlookAsyncText(username, password, subject, body, {address.Address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncText(username, password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncText(username, password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncText(username, password, subject, body, addressCollection) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncText(username, password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncText(username, password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) As Task Await MailUtil.SendOutlookAsyncText(username, password, subject, body, addresses, attachments:=Nothing) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) As Task Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment Await MailUtil.SendOutlookAsyncText(username, password, subject, body, addresses, attachCol) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' Await SendOutlookAsyncText("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsync(username, password, subject, body, addresses, attachments, isBodyHtml:=False) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String) As Task Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, {address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) As Task Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, {address.Address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, addressCollection) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) As Task Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, addresses, attachments:=Nothing) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) As Task Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment Await MailUtil.SendOutlookAsyncText(credential.UserName, credential.Password, subject, body, addresses, attachCol) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a plain text body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncText(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsync(credential.UserName, credential.Password, subject, body, addresses, attachments, isBodyHtml:=False) End Function #End Region #Region " (ASYNC) HTML Body " ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String) As Task Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, {address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) As Task Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, {address.Address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, addressCollection) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) As Task Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, addresses, attachments:=Nothing) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) As Task Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment Await MailUtil.SendOutlookAsyncHtml(username, password, subject, body, addresses, attachCol) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' Await SendOutlookAsyncHtml("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsync(username, password, subject, body, addresses, attachments, isBodyHtml:=False) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", "Address@Server.com") ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String) As Task Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, {address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", "Address@Server.com", New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", "Address@Server.com", attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As String, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, {address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress) As Task Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, {address.Address}) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ParamArray attachments As Attachment()) As Task Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", New MailAddress("Address@Server.com"), attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="address"> ''' The target address that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal address As MailAddress, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, {address.Address}, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, addressCollection) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ParamArray attachments As Attachment()) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", {"Address1@Server.com", "Address2@Server.com"}, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As String(), ByVal attachments As Collection(Of Attachment)) As Task Dim addressCollection As New MailAddressCollection For Each address As String In addresses addressCollection.Add(New MailAddress(address)) Next address Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, addressCollection, attachments) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", addressCollection) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection) As Task Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, addresses, attachments:=Nothing) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", addressCollection, New Attachment("C:\File.txt")) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ParamArray attachments As Attachment()) As Task Dim attachCol As New Collection(Of Attachment) For Each attachment As Attachment In attachments attachCol.Add(attachment) Next attachment Await MailUtil.SendOutlookAsyncHtml(credential.UserName, credential.Password, subject, body, addresses, attachCol) End Function ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail with a HTML body through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim credential As New NetworkCredential("Username@Hotmail.com", "Password") ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", addressCollection, attachments) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="credential"> ''' The credential containing the username and password for the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsyncHtml(ByVal credential As NetworkCredential, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment)) As Task Await MailUtil.SendOutlookAsync(credential.UserName, credential.Password, subject, body, addresses, attachments, isBodyHtml:=True) End Function #End Region #End If #End Region #Region " Private Methods " ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Sends a mail through Microsoft Outlook Live service. ''' <para></para> ''' Note that in order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' SendOutlook("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, attachments, isBodyHtml:=False) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <remarks> ''' In order to send SMTP messages, you must enable application access for your Outlook live account by following this url: ''' <para></para> ''' <see href="http://www.google.com/settings/security/lesssecureapps"/> ''' </remarks> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ''' <param name="isBodyHtml"> ''' Indicates whether the mail body is html or plain text. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Private Shared Sub SendOutlook(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment), ByVal isBodyHtml As Boolean) Using msg As New MailMessage For Each address As MailAddress In addresses msg.To.Add(address) Next address msg.From = New MailAddress(username) msg.Subject = subject msg.IsBodyHtml = isBodyHtml msg.Body = body For Each attachment As Attachment In attachments msg.Attachments.Add(attachment) Next attachment Using client As New SmtpClient() With client .Host = "smtp.live.com" .Port = 587 .EnableSsl = True .DeliveryMethod = SmtpDeliveryMethod.Network .Timeout = CInt(TimeSpan.FromSeconds(60).TotalMilliseconds) .Credentials = New NetworkCredential(username, password) End With client.Send(msg) End Using End Using End Sub #If NET45 OrElse NET46 Then ''' ---------------------------------------------------------------------------------------------------- ''' <summary> ''' Asynchronously sends a mail through Microsoft Outlook Live service. ''' </summary> ''' ---------------------------------------------------------------------------------------------------- ''' <example> This is a code example. ''' <code> ''' Dim addressCollection As New MailAddressCollection ''' addressCollection.Add(New MailAddress("Address@Server.com")) ''' addressCollection.Add(New MailAddress("Address2@Server.com")) ''' ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")} ''' ''' Await SendOutlookAsync("Username@Hotmail.com", "Password", "Email Subject", "Message Body", addressCollection, attachments, isBodyHtml:=False) ''' </code> ''' </example> ''' ---------------------------------------------------------------------------------------------------- ''' <param name="username"> ''' The username of the Outlook live account. ''' </param> ''' ''' <param name="password"> ''' The password of the Outlook live account. ''' </param> ''' ''' <param name="subject"> ''' The mail subject. ''' </param> ''' ''' <param name="body"> ''' The mail body. ''' </param> ''' ''' <param name="addresses"> ''' The target addresses that will receive our sent mail. ''' </param> ''' ''' <param name="attachments"> ''' The file(s) to attach in this e-mail. ''' </param> ''' ''' <param name="isBodyHtml"> ''' Indicates whether the mail body is html or plain text. ''' </param> ''' ---------------------------------------------------------------------------------------------------- <DebuggerStepThrough> Public Shared Async Function SendOutlookAsync(ByVal username As String, ByVal password As String, ByVal subject As String, ByVal body As String, ByVal addresses As MailAddressCollection, ByVal attachments As Collection(Of Attachment), ByVal isBodyHtml As Boolean) As Task Using msg As New MailMessage For Each address As MailAddress In addresses msg.To.Add(address) Next msg.From = New MailAddress(username) msg.Subject = subject msg.IsBodyHtml = isBodyHtml msg.Body = body For Each attachment As Attachment In attachments msg.Attachments.Add(attachment) Next attachment Using client As New SmtpClient() With client .Host = "smtp.live.com" .Port = 587 .EnableSsl = True .DeliveryMethod = SmtpDeliveryMethod.Network .Timeout = CInt(TimeSpan.FromSeconds(60).TotalMilliseconds) .Credentials = New NetworkCredential(username, password) End With Dim t As Task = client.SendMailAsync(msg) Await t End Using End Using End Function #End If #End Region End Class End Namespace #End Region
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Crypto Money Attack
CSS | 53 min ago | 0.21 KB
API Glitch (Up to 1 BTC)
CSS | 53 min ago | 0.21 KB
This summer smells like money
CSS | 53 min ago | 0.21 KB
redteam-deface
HTML | 5 hours ago | 3.15 KB
Untitled
9 hours ago | 0.04 KB
Sparkle Animation Review Template
17 hours ago | 1.20 KB
more sc
17 hours ago | 0.15 KB
EM Operational: Client wants to see a list of...
18 hours ago | 1.46 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!