1
votes

I'm trying to use the Send-MailMessage commandlet in Powershell. It requires that I tell is my SMTP server settings.

I am running an Outlook 2016 desktop client that is associated with my Office 365 subscription. How do I get to know the Smtp server settings?

I tried File -> Account Settings but that doesn't show me the server url and the port number.

1
outlook.office.com/owa/?path=/options/popandimap That's to get your smtp settings... If you want to send email, you just need theses. If the real interest lies in grabbing those informations from outlook client, I am not familiar enough with the outlook interop to be of much use there. - Sage Pourpre

1 Answers

0
votes

If your mail is hosted by Office365, then it will have the same SMTP settings...

Server: smtp.office365.com
Port: 587 or 25
TLS: Enabled

Send-MailMessage -To <email> -Cc <email> -Attachments <path> -SmtpServer "smtp.office365.com" -Credential $mycreds -UseSsl -Port "587"

link