0

I have various PowerShell scripts on Windows Server 2012 R2 that I like to notify me via email upon completion, so I setup a local SMTP server that is restricted to 127.0.0.1 only, and use this command:

Send-MailMessage -To "myemail@gmail.com" -From "myemail@gmail.com" -SMTPServer localhost -Subject "Script 1" -Body "Script 1 has finished"

But the problem is GMail and other services says "Beware" or put it in SPAM. Is there any From email or something I can quickly/easily do to get it to hit my inbox without issue?

Edit: This is from a Microsoft Demo VM with Contoso.com domain.

Edit 2: The domain "contoso.com" is a fictional domain that I can't setup an SPF record for.

Can I somehow set the reply from the server's actual IP address so that email servers consider it "genuine"?

Alex K
  • 103
  • 6
  • Does your domain have SPF records setup? This is usually resolved with correct SPF. – Gmck Jan 14 '16 at 18:27
  • I highly doubt anything is setup. It's a Microsoft Demo VM, with contoso.com domain. – Alex K Jan 14 '16 at 18:37
  • Get the correct domain and from email address set up, add SPF records, etc. Then see if there is any improvement. – Michael Hampton Jan 14 '16 at 18:38
  • Also don’t forget about PTR (Reverse DNS) settings. – Giacomo1968 Jan 14 '16 at 18:39
  • 2
    Possible duplicate of [How to send emails and avoid them being classified as spam?](http://serverfault.com/questions/48428/how-to-send-emails-and-avoid-them-being-classified-as-spam) – Giacomo1968 Jan 14 '16 at 18:39
  • The domain is just a generic fictional domain, so I don't think I can setup SPF records or anything to say it's genuine. Is there a way to set the reply to be from the server IP address so it appears "genuine" to other mail servers? – Alex K Jan 14 '16 at 18:45
  • 2
    Again, you need to _change_ the domain! – Michael Hampton Jan 14 '16 at 18:53

0 Answers0