Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' ***********************************************************************
- ' 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' SendOutlookText("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' SendOutlookText("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")}
- '''
- ''' SendOutlookText("[email protected]", "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("[email protected]", "Password")
- ''' SendOutlookText(credential, "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password")
- ''' SendOutlookText(credential, "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "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", "[email protected]", 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("[email protected]", "Password")
- ''' SendOutlookText(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password")
- ''' SendOutlookText(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "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("[email protected]"), 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("[email protected]", "Password")
- ''' SendOutlookText(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password")
- ''' SendOutlookText(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "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", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' SendOutlookHtml("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' SendOutlookHtml("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")}
- '''
- ''' SendOutlookHtml("[email protected]", "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("[email protected]", "Password")
- ''' SendOutlookHtml(credential, "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password")
- ''' SendOutlookHtml(credential, "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "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", "[email protected]", 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("[email protected]", "Password")
- ''' SendOutlookHtml(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password")
- ''' SendOutlookHtml(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "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("[email protected]"), 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("[email protected]", "Password")
- ''' SendOutlookHtml(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password")
- ''' SendOutlookHtml(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "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", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' Await SendOutlookAsyncText("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' Await SendOutlookAsyncText("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")}
- '''
- ''' Await SendOutlookAsyncText("[email protected]", "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("[email protected]", "Password")
- ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password")
- ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "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", "[email protected]", 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("[email protected]", "Password")
- ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password")
- ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "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("[email protected]"), 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("[email protected]", "Password")
- ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password")
- ''' Await SendOutlookAsyncText(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "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", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password", "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' Await SendOutlookAsyncHtml("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' Await SendOutlookAsyncHtml("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")}
- '''
- ''' Await SendOutlookAsyncHtml("[email protected]", "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("[email protected]", "Password")
- ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", "[email protected]")
- ''' </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("[email protected]", "Password")
- ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", "[email protected]", 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("[email protected]", "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", "[email protected]", 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("[email protected]", "Password")
- ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"))
- ''' </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("[email protected]", "Password")
- ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", New MailAddress("[email protected]"), 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("[email protected]", "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("[email protected]"), 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("[email protected]", "Password")
- ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"})
- ''' </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("[email protected]", "Password")
- ''' Await SendOutlookAsyncHtml(credential, "Email Subject", "Message Body", {"[email protected]", "[email protected]"}, 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("[email protected]", "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", {"[email protected]", "[email protected]"}, 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' 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("[email protected]", "Password")
- ''' Dim addressCollection As New MailAddressCollection
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' 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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")}
- '''
- ''' SendOutlook("[email protected]", "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("[email protected]"))
- ''' addressCollection.Add(New MailAddress("[email protected]"))
- '''
- ''' Dim attachments As New Collection(Of Attachment) From {New Attachment("C:\File1.txt"), New Attachment("C:\File2.txt")}
- '''
- ''' Await SendOutlookAsync("[email protected]", "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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement