culter
culter

Reputation: 5697

powershell or net sending emails with authentication

I'm using powershell cmdlet

send-mailmessage `
                    -SmtpServer 192.168.170.56 `
                    -to "<[email protected]>" `
                    -from "SFRBsendingScr <[email protected]>" `
                    -subject "(test) PRIMFRB transfer $date" `
                    -body "$teloadmin" -BodyAsHtml `
                    -ErrorAction Stop

for sending emails, but our smtp server (LotusNotes) require authentication to send emails out of our company. Ho can I add authentication, or is there another way to do it? Thank you

Upvotes: 2

Views: 1310

Answers (1)

CB.
CB.

Reputation: 60910

As i commented you can add -credential parameter to send-mailmessage like -credential (get-credential) and fill it using valid userid and password

Upvotes: 2

Related Questions