muquit / mailsend

A program to send mail via SMTP from command line
Other
297 stars 68 forks source link

MailSend sends nothing if -attach file doesn't exist #131

Open sk5910 opened 6 years ago

sk5910 commented 6 years ago

Hello,

This is one of those funny ones.

If the file specified in the -attach parameter of mailsend doesn't exist, mailsend sends nothing (ie no email at all). In a Windows BAT file scenario, where mailsend is sending email alerts, the result is that effectively nothing happens & there is no log/trace to review...

Would it be possible/reasonable for mailsend to (?) attach a dummy file to the email & send anyway??
Eg. If I mailsend -attach c:\file.txt & c:\file.txt doesn't exist, maybe attach a construct called file.txt with the name of the missing file inside. Or attach "missing-file.txt" to the email that contains the name of the requested file??