简体   繁体   中英

how to send email as anonymous authentication in powershell

I have never used power shell before but my understanding is that it is best way of sending email on windows machine .

My network has provided me following details

SMTP sever
Port
Authentication : Anonymous
From :
To:

Now when I am looked and researched internet I found we need username and password for sending email.

Is there any way I can send email using anonymous authentication with only server name provided and also include atatchment

Thanks in advance

The mail server will do an anonymous relay depends on the configuration of the Recieve Connectors.So, Run the Send-MailMessage on the Exchange server and use 'localhost' as your SMTPServer, then it won't go through a receive connector.
Note: Your email user should exist and part of a valid domain.Then you can send from noreply@ or whatever you want to use.

send-mailmessage -From "noreply@example.com" -To "user01@example.com", "user02@example.com" -Bcc "user03@example.com" -Subject "Anonymous Mail Subject" -Body "Anonymous test Body" -SmtpServer 'localhost' -Port 25

*Note:*25 is the default smtp port.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM