You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
37
37
- Added `-CanSyncHubSitePermissions` parameter to `Set-PnPSite` cmdlet to set value of allowing syncing hub site permissions to this associated site.
38
38
- Added `Get-PnPProfileCardProperty`, `New-PnPProfileCardProperty` and `Remove-PnPProfileCardProperty` cmdlets to manage showing additional properties on the Microsoft 365 user profile [#4548](https://github.com/pnp/powershell/pull/4548)
39
39
- Added `-Contributors` and `-Managers` parameters to `New-PnPTermGroup` and `Set-PnPTermGroup` cmdlets.
40
+
- Added `-Files` parameter for `Send-PnPMail` cmdlet to allow files to be downloaded from SharePoint and then sent as attachments.
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].
55
61
62
+
### EXAMPLE 4
63
+
```powershell
64
+
Send-PnPMail -From "[email protected]" -To "[email protected]" -Subject "Test message" -Body "This is a test message" -Attachments "C:\PnPCommunity\Test\test.docx"
65
+
```
66
+
67
+
Sends an e-mail using Microsoft Graph to one recipient. E-mail is sent from the user specified in the From parameter and can be sent to both internal and external addresses. A copy of the sent e-mail will be stored in the mailbox of the user specified in the From parameter. It will also upload the file from the local file system as attachment.
68
+
69
+
### EXAMPLE 5
70
+
```powershell
71
+
Send-PnPMail -From "[email protected]" -To "[email protected]" -Subject "Test message" -Body "This is a test message" -Files "/sites/test/Shared Documents/Test.docx"
72
+
```
73
+
74
+
Sends an e-mail using Microsoft Graph to one recipient. E-mail is sent from the user specified in the From parameter and can be sent to both internal and external addresses. A copy of the sent e-mail will be stored in the mailbox of the user specified in the From parameter. It will also upload the file from the SharePoint site collection and send it as attachment.
75
+
56
76
## PARAMETERS
57
77
58
78
### -Body
@@ -102,7 +122,7 @@ Allows defining what type of content is in the Body parameter. Defaults to HTML.
102
122
103
123
```yaml
104
124
Type: MessageBodyContentType
105
-
Parameter Sets: Send through Microsoft Graph
125
+
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
106
126
Accepted values: Html, Text
107
127
108
128
Required: False
@@ -131,7 +151,7 @@ The sender of the e-mail. When Microsoft Graph is used, this can be a user or a
131
151
132
152
```yaml
133
153
Type: String
134
-
Parameter Sets: Send through Microsoft Graph
154
+
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
135
155
136
156
Required: True
137
157
Position: Named
@@ -145,7 +165,7 @@ Allows defining what the importance of the e-mail is. Defaults to Normal.
145
165
146
166
```yaml
147
167
Type: MessageImportanceType
148
-
Parameter Sets: Send through Microsoft Graph
168
+
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
149
169
Accepted values: Low, Normal, High
150
170
151
171
Required: False
@@ -160,7 +180,7 @@ List of return addresses to use for the e-mail
160
180
161
181
```yaml
162
182
Type: String[]
163
-
Parameter Sets: Send through Microsoft Graph
183
+
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
164
184
165
185
Required: False
166
186
Position: Named
@@ -174,7 +194,7 @@ Allows indicating if the sent e-mail should be stored in the Sent Items of the m
174
194
175
195
```yaml
176
196
Type: String[]
177
-
Parameter Sets: Send through Microsoft Graph
197
+
Parameter Sets: Send through Microsoft Graph with attachments from SPO, Send through Microsoft Graph with attachments from local file system
178
198
179
199
Required: False
180
200
Position: Named
@@ -211,6 +231,34 @@ Accept pipeline input: False
211
231
Accept wildcard characters: False
212
232
```
213
233
234
+
### -Attachments
235
+
List of attachments from local file system to be uploaded and sent as attachments.
236
+
237
+
```yaml
238
+
Type: String[]
239
+
Parameter Sets: Send through Microsoft Graph with attachments from local file system
240
+
241
+
Required: False
242
+
Position: Named
243
+
Default value: None
244
+
Accept pipeline input: False
245
+
Accept wildcard characters: False
246
+
```
247
+
248
+
### -Files
249
+
List of files from the SharePoint site collection to be sent as attachments.
250
+
251
+
```yaml
252
+
Type: String[]
253
+
Parameter Sets: Send through Microsoft Graph with attachments from SPO
254
+
255
+
Required: False
256
+
Position: Named
257
+
Default value: None
258
+
Accept pipeline input: False
259
+
Accept wildcard characters: False
260
+
```
261
+
214
262
## RELATED LINKS
215
263
216
264
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
0 commit comments