forked from pnp/powershell
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update PowerShell version requirements and added warning about SendEm…
…ail API retirement (pnp#4558) Co-authored-by: Gautam Sheth <[email protected]>
- Loading branch information
1 parent
e6cbff6
commit 5b34163
Showing
6 changed files
with
40 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,15 +26,9 @@ Send-PnPMail -From <String> -To <String[]> -Subject <String> -Body <String> [-Cc | |
Send-PnPMail -To <String[]> -Subject <String> -Body <String> [-Cc <String[]>] [-Bcc <String[]>] [-Connection <PnPConnection>] [-Verbose] | ||
``` | ||
|
||
### Send through SMTP | ||
|
||
```powershell | ||
Send-PnPMail -Server <String> -From <String> -To <String[]> -Subject <String> -Body <String> [-Cc <String[]>] [-Bcc <String[]>] [-Importance <MessageImportanceType>] [-BodyContentType <MessageBodyContentType>] [-ServerPort <short>] [-EnableSsl <bool>] [-Username <String>] [-Password <String>] [-Connection <PnPConnection>] [-Verbose] | ||
``` | ||
|
||
## DESCRIPTION | ||
|
||
Allows sending an e-mail through SharePoint Online, SMTP or Microsoft Graph. Sending e-mail through Microsoft Graph requires the Mail.Send permission. | ||
Allows sending an e-mail through SharePoint Online or Microsoft Graph. Sending e-mail through Microsoft Graph requires the **Mail.Send** permission. | ||
|
||
## EXAMPLES | ||
|
||
|
@@ -59,27 +53,6 @@ Send-PnPMail -To "[email protected]" -Subject "Test message" -B | |
|
||
Sends an e-mail using the SharePoint Online SendEmail method using the current context. E-mail is sent from the SharePoint Online no-reply e-mail address and can only be sent to accounts in the same tenant. The from address will show the title of the site you are connected with along with the e-mail address [email protected]. | ||
|
||
### EXAMPLE 4 | ||
```powershell | ||
Send-PnPMail -From "[email protected]" -To "[email protected]" -Subject "Test message" -Body "This is a test message" -Server contoso.mail.protection.outlook.com | ||
``` | ||
|
||
Sends an e-mail via the SMTP service belonging to a specific tenant. E-mail is sent from the user specified in the From parameter and can be sent only to addresses residing in the tenant you address through the Server parameter, in this case contoso. | ||
|
||
### EXAMPLE 5 | ||
```powershell | ||
Send-PnPMail -From "[email protected]" -To "[email protected]" -Subject "Test message" -Body "This is a test message" -Server smtp.myisp.com | ||
``` | ||
|
||
Sends an e-mail via a custom SMTP server of your Internet Service Provider which does not require authentication and uses port TCP 25. E-mail is sent from the user specified in the From parameter and can be sent to both internal and external addresses. | ||
|
||
### EXAMPLE 6 | ||
```powershell | ||
Send-PnPMail -From "[email protected]" -To "[email protected]" -Subject "Test message" -Body "This is a test message" -Server smtp.myisp.com -Port 587 -EnableSsl:$true -Username "userxyz" -Password "password123" | ||
``` | ||
|
||
Sends an e-mail via a custom SMTP server of your Internet Service Provider which requires authentication and uses SSL over port TCP 587. E-mail is sent from the user specified in the From parameter and can be sent to both internal and external addresses. | ||
|
||
## PARAMETERS | ||
|
||
### -Body | ||
|
@@ -129,7 +102,7 @@ Allows defining what type of content is in the Body parameter. Defaults to HTML. | |
```yaml | ||
Type: MessageBodyContentType | ||
Parameter Sets: Send through Microsoft Graph, Send through SMTP | ||
Parameter Sets: Send through Microsoft Graph | ||
Accepted values: Html, Text | ||
|
||
Required: False | ||
|
@@ -153,26 +126,12 @@ Accept pipeline input: False | |
Accept wildcard characters: False | ||
``` | ||
### -EnableSsl | ||
Allows you to specify if SSL should be used when connecting to the SMTP server. Only used when the Server parameter is specified. | ||
```yaml | ||
Type: Boolean | ||
Parameter Sets: Send through SMTP | ||
|
||
Required: False | ||
Position: Named | ||
Default value: False | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -From | ||
The sender of the e-mail. When Microsoft Graph is used, this can be a user or a shared mailbox. | ||
```yaml | ||
Type: String | ||
Parameter Sets: Send through SMTP, Send through Microsoft Graph | ||
Parameter Sets: Send through Microsoft Graph | ||
|
||
Required: True | ||
Position: Named | ||
|
@@ -186,7 +145,7 @@ Allows defining what the importance of the e-mail is. Defaults to Normal. | |
```yaml | ||
Type: MessageImportanceType | ||
Parameter Sets: Send through Microsoft Graph, Send through SMTP | ||
Parameter Sets: Send through Microsoft Graph | ||
Accepted values: Low, Normal, High | ||
|
||
Required: False | ||
|
@@ -196,34 +155,6 @@ Accept pipeline input: False | |
Accept wildcard characters: False | ||
``` | ||
### -Username | ||
Username to use to authenticate to the outbound mailserver. Only used when the Server parameter is specified and if not provided, an anonymous connection will be made with the SMTP server specified through Server. | ||
```yaml | ||
Type: String | ||
Parameter Sets: Send through SMTP | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -Password | ||
Password to use to authenticate to the outbound mailserver. Only used when the Server parameter is specified and if not provided, an anonymous connection will be made with the SMTP server specified through Server. | ||
```yaml | ||
Type: String | ||
Parameter Sets: Send through SMTP | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -ReplyTo | ||
List of return addresses to use for the e-mail | ||
|
@@ -252,34 +183,6 @@ Accept pipeline input: False | |
Accept wildcard characters: False | ||
``` | ||
### -Server | ||
SMTP server to use to send the e-mail. You can use the SMTP server of your Internet Service Provider or the SMTP server of your tenant by using tenant.mail.protection.outlook.com where you replace tenant with your own tenant name. This allows you to send e-mail without requiring any authentication, but only to recipients in that tenant. Use a custom SMTP server if you want to send e-mail to various external recipients or go for the Microsoft Graph option in which case you don't specify a server. | ||
```yaml | ||
Type: String | ||
Parameter Sets: Send through SMTP | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -ServerPort | ||
SMTP server port to use to send the e-mail. Used in combination with the Server parameter. Defaults to 25. | ||
```yaml | ||
Type: String | ||
Parameter Sets: Send through SMTP | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -Subject | ||
Subject of the email | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.