Comments (6)
Try using PS 7, it should provide better error reporting. Also do you have proper rights to upload files? As ReadWrite Emails? Send is not enough.
from mailozaurr.
Same with PS7 (do I have to "reinstall" the module for PS7?):
Yes, both, my managed identity and the app registration have Mail.Send and Mail.ReadWrite. (That should be fine, because it worked with the client secret for the same app registration.)
from mailozaurr.
You don't have to reinstall module.
Just to clarify:
- Does it work for 4MB plus with Connect-MgGraph and MgGraphRequest with ClientSecret?
- It doesn't work with Connect-MgGraph and MgGraphRequest with Certificate?
from mailozaurr.
And I assume in all cases the mailbox does exists? The one you're sending it with?
from mailozaurr.
You don't have to reinstall module.
Just to clarify:
- Does it work for 4MB plus with Connect-MgGraph and MgGraphRequest with ClientSecret?
Yes. I just tried it again (also without executing Connect-MgGraph before) by just adding the -Credential parameter with the ClientSecret. Works like a charm. (The parameter -MgGraphRequeset was not added.)
- It doesn't work with Connect-MgGraph and MgGraphRequest with Certificate?
Yes. I used Connect-MgGraph with my certificate before executing Send-EmailMessage.
(-Credential parameter of Send-EmailMessage removed and -MgGraphRequest added instead.)
And I assume in all cases the mailbox does exists? The one you're sending it with?
Correct. (It's the always the same mailbox and I also tried it with a different one, but the error is the same.)
from mailozaurr.
I'm now using the following workaround without the need for a client secret:
$null = Connect-AzAccount -Identity
[System.Object]$AccessToken = (Get-AzAccessToken -ResourceTypeName 'MSGraph' -AsSecureString -WarningAction 'SilentlyContinue').Token
[System.Object]$Credentials = ConvertTo-GraphCredential -MsalToken ([System.Net.NetworkCredential]::new('', $AccessToken).Password)
[System.String[]]$Attachments = @(XXX)
Send-EmailMessage -From 'XXX' -To 'XXX' -HTML "XXX" -Subject 'XXX' -Graph -ReplyTo "XXX" -Credential $Credentials -Attachment $Attachments -DoNotSaveToSentItems
from mailozaurr.
Related Issues (20)
- FIlename containing ie round brackets dont show correctly in attachment
- Small problem with Email-name
- Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe HOT 3
- how to correctly download attachment HOT 7
- Is there any way how to get path to email item ? HOT 1
- MX Record IPAddress with -Separate HOT 5
- Get 403 after using Send-EmailMessage HOT 6
- From field should be mandatory
- If Path doesn't exists, an error occurs (attachments) HOT 1
- How to delete mail from IMAP ?
- Adapting "from" with custom name HOT 1
- Can't send attachment > 3Mb using Graph HOT 2
- SkipCertificateValidation => wrong naming HOT 2
- Feature Request: SkipCertificateCheck on Connect-IMAP/Connect-POP3
- Logging HOT 5
- Cannot update Mailozaurr 1.0.2 - not trusted any longer HOT 2
- -AttachSelf option like in Emailimo HOT 1
- -SkipCertificateValidatation does not seem to work HOT 2
- When path to attachment is empty error should be handled better when using Graph
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailozaurr.