clothingopk.blogg.se

Microsoft secure email powershell
Microsoft secure email powershell











microsoft secure email powershell

The problem is, neither of them addressed both your needs (Attachment with a password), so I did some combination of the two and came up with this: $EmailTo = "Test" I also found this question: send-mail-via-gmail-with-powershell-v2s-send-mailmessage I learned about PScredentials but not exactly sure what it is and how to use it in this context. So I need help from you guys on how do I pass my Credentials to the Send-MailMessage command. from -to -subject 'Test' -attachment C:\CDF.pdfĪnd still it fails with the exact same error. Then I run below command: Send-MailMessage -smtpServer -credentail $mycredentials `

microsoft secure email powershell

Then entered my usrname and password for gmail in the box that pops up. I tried with Get-Credentials as below: $mycredentials = Get-Credential

microsoft secure email powershell

I googled a bit and also went through the man page of Send-MailMessage and found that the "-credential" parameter needs to be passed. The server response was: 5.7.0 Must issue a STARTTLS command first. It errors with below the message which is obviously because I have not passed my gmail credentials Send-MailMessage : The SMTP server requires a secure connection or the client was notĪuthenticated. to -subject 'Test' -attachment C:\CDF.pdf This is what I am running: Send-MailMessage -smtpServer -from ` I'm having difficulty passing my credentials to the Send-MailMessage command













Microsoft secure email powershell