Send a message to one predefined emailaddress

0

this might sound like a strange question..... I'm looking for an desktop app, or software, where I can send a message, with an attachment to 1 predefined emailaddress. So, if you push on the 'send' button, the message is sent by email to a predefined mailaddress.

Using a regular emailprogram is not an option :-)

Is there something out there? or could it be made for instance in C#?

Thanks!

Christophe

Posted 2020-02-06T15:51:40.537

Reputation: 1

Question was closed 2020-02-06T19:00:30.353

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

Answers

1

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.

Mikey T.K.

Posted 2020-02-06T15:51:40.537

Reputation: 3 224

1Instead of using the SMTP server of the recipient (which is what you seem to propose), you should probably use your SMTP server (which is what regular email programs do, too). That should get around problems with DKIM etc. Of course, you may need to specify SMTP authentication credentials - not sure Send-MailMessage supports that. – sleske – 2020-02-06T16:28:07.947

The example given was copied straight from the docs and seems to assume that both the sender and the recipient are on the Fabrikam network. – Mikey T.K. – 2020-02-06T21:43:14.213

Yes, when both are on the same network, that is indeed the easiest solution. As to SMTP authentication, I read on a blog that that is supported using the -Credential parameter. I did not try it out though. – sleske – 2020-02-07T08:57:09.980