bhieb
asked on
Powershell send smtp emaiil to server with CNAME alias
Ok I have a weird scenario. I have a legacy device that takes an SMTP server value, but the field is too short for our o365 domain. It worked fine with the old server name mailtest.ourdomain.com when the exchange server was local. I cannot get the devs to update the field length so I thought I'd try to do it via DNS using a cname alias. Using a NSLOOKUP on mailtest.ourdomain.com returns the IP for the external o365 address and it lists the alias ourdomain-com.mail.protect ion.outloo k.com.
However to test I fired up powershell and ran this, only to get. "The remote name could not be resolved"
Running it directly to o365 works.
However to test I fired up powershell and ran this, only to get. "The remote name could not be resolved"
Send-Mailmessage -to "me@ourdomain.com" -from "test@ourdomain.com" -subject "Test" -body "Test" -smtpserver "mailtest.ourdomain.com"
Running it directly to o365 works.
Send-Mailmessage -to "me@ourdomain.com" -from "test@ourdomain.com" -subject "Test" -body "Test" -smtpserver "ourdomain-com.mail.protection.outlook.com"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank goodness, you had me confused :)