Powershell has a Send-MailMessage cmdlet that may do what you want.
Among its arguments, it takes a from address, to address, subject, attachments, and outgoing SMTP server.
Example from the linked docs:
Send-MailMessage -From 'User01 <user01@fabrikam.com>' -To 'User02 <user02@fabrikam.com>', 'User03 <user03@fabrikam.com>' -Subject 'Sending the Attachment' -Body "Forgot to send the attachment. Sending now." -Attachments .\data.csv -Priority High -DeliveryNotificationOption OnSuccess, OnFailure -SmtpServer 'smtp.fabrikam.com'
If this message is destined for someone on the internet rather than to a client in your enterprise, the sending system will need to have forward and reverse DNS addresses, DKIM and SPF, and so forth set up, or else the message will likely wind up in the recipient's spam folder.
Also note that Send-MailMessage
does not support SMTP authentication. If you use this, you'll need to set the value of -SmtpServer
to a server that does not require this authentication, ideally one under your or your company's control.
3If you can explain your requirements and use-case (and why a standard email client isn't acceptable), you might do better asking in [softwarerecs.se]. – Jeff Zeitlin – 2020-02-06T15:54:07.270
Might be doable in PowerShell – LPChip – 2020-02-06T15:58:28.533