Send-MailMessage

Hey Everyone,

I’m trying to create a script that will send an email to a user if there are some orphan .smtp files in a specific location. The .smtp file contains 2 entries. The 1st line is the users email address and the 2nd line is the email that was sent to. Here’s a sample of my code if anyone could take a look at it. https://github.com/Dilydali/SendMailMessage/blob/a022c85387082426400665419435cff3001fe1b6/SendMailMessage_Newforma1.ps1

Currently the script will write the contents of the file to the screen, but I cannot get it to prompt for the credentials in my send-mailmessage paramaters.

Just a note: The Write-Host is to verify the correct info is being pulled and will be removed when the script is working. The Get-Credential portion of my Send-MailMessage Parameters is there for testing purposes as well.

Thanks,

Edit: Also, typos will be fixed as well… 🙂

submitted by /u/Dilydali
[link] [comments]

Leave a Reply