external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Sends an email using the Office 365 SMTP Service or SharePoint, depending on the parameters specified. See detailed help for more information.
Send-PnPMail -To <String[]>
-Subject <String>
-Body <String>
[-Server <String>]
[-From <String>]
[-Password <String>]
[-Cc <String[]>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
PS:> Send-PnPMail -To address@tenant.sharepointonline.com -Subject test -Body test
Sends an e-mail using the SharePoint SendEmail method using the current context. E-mail is sent from the system account and can only be sent to accounts in the same tenant
PS:> Send-PnPMail -To address@contoso.com -Subject test -Body test -From me@tenant.onmicrosoft.com -Password xyz
Sends an e-mail via Office 365 SMTP and requires a from address and password. E-mail is sent from the from user and can be sent to both internal and external addresses.
PS:> Send-PnPMail -To address@contoso.com -Subject test -Body test -From me@server.net -Password xyz -Server yoursmtp.server.net
Sends an e-mail via a custom SMTP server and requires a from address and password. E-mail is sent from the from user.
Body of the email
Type: String
Parameter Sets: (All)
Required: True
Position: Named
Accept pipeline input: False
List of recipients on CC
Type: String[]
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
If using from address, you also have to provide a password
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
If using a password, you also have to provide the associated from address
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Subject of the email
Type: String
Parameter Sets: (All)
Required: True
Position: Named
Accept pipeline input: False
List of recipients
Type: String[]
Parameter Sets: (All)
Required: True
Position: Named
Accept pipeline input: False
Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
Type: SPOnlineConnection
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.
Type: WebPipeBind
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False