Table of contents
TOC
Collapse the table of content
Expand the table of content

MailUtility.SendEmailAsync Method

SharePoint Dev Documents|Last Updated: 5/19/2017
|
1 Contributor

Sends an email via Office 365 SMTP as an asynchronous operation

Namespace:OfficeDevPnP.Core.Utilities
Assembly: OfficeDevPnP.Core.dll

Syntax

public static Task SendEmailAsync(String servername, String fromAddress, SecureString fromUserPassword, IEnumerable<String> to, IEnumerable<String> cc, String subject, String body)

Parameters

servername

  Type: System.String
  Office 365 SMTP address. By default this is smtp.office365.com.

fromAddress

  Type: System.String
  The user setting up the SMTP connection. This user must have an EXO license.

fromUserPassword

  Type: System.Security.SecureString
  The secure password of the user.

to

  Type: System.Collections.Generic.IEnumerable<System.String>
  List of TO addresses.

cc

  Type: System.Collections.Generic.IEnumerable<System.String>
  List of CC addresses.

subject

  Type: System.String
  Subject of the mail.

body

  Type: System.String
  HTML body of the mail.

Return Value

Type: Task

See also

© 2018 Microsoft