I would like to send an email with powershell with credentials already entered using a batch file (not a powershell script).
I need this because it is a program where someone could request a feature, but it would use my email to send whatever they put in to myself. I don't want to have to give them my password.
I tried this, but it only works for the username, not the password:
powershell Send-MailMessage -To ansorensen1118@gmail.com -From ansorensen1118@gmail.com -Subject Testing -Body Testing -Credential (new-object System.Net.NetworkCredential("username","password"))' -SmtpServer smtp.gmail.com -UseSsl