Question

I'm hunting for a mail sending program which can be used with command line arguments.

Ive tried jaber's sendmail . Its really neat, but its unfortunately broken for SSL auth.

Any alternatives ?

(Oh yeah, I dont want to use perl :P)

Was it helpful?

Solution 4

A weird option : You can get the sendmail.cpp and .h and include in your project. It uses blat internally in a very exotic way.

I was thinking of launching the cmd prompt earlier using ShellExecute(..) to send mails but this is a much more mysterious way of sending mails.

OTHER TIPS

You can use a small PowerShell script:

$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($emailFrom, $emailTo, $subject, $body)

Values to the function calls must be retrieved from the command line parameters using the $args array.

You could use exim under windows by installing cygwin. I've used it as an outgoing MTA on windows before. Pretty sure it has a sendmail facade as well.

As Reno mentions SSL in his question I suggest to keep in mind that Net.Mail.SmtpClient only supports Explicit SSL. In practice you usually will be ok if you use port 587 instead of 465 like your mail client application does. See more details here

System.Net.Mail with SSL to authenticate against port 465

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top