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)
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)
A werid 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. Har Har!
Geez I always end up answering my own question.
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.
> Googling your question's title gives plenty of results...
Totally Right. Incredible to see again such questions answered 250 000 times for 20 years !
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