2

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.

Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
  • https://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 Sep 06 '17 at 18:15

1 Answers1

0

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

Alex
  • 498
  • 2
  • 8