Computer Hope
Microsoft => Microsoft DOS => Topic started by: OutThere on August 20, 2008, 01:30:01 PM
-
I need to send an email from the command line/batch script. I am currently using MSMTP for this. I'd be willing to change BUT the program MUST be able to send using a Gmail account.
I've got MSMTP configured and use the following to send a message:
echo Subject: Hi | msmtp [email protected]
or:
msmtp [email protected] < C:\message
where C:\message contains:
Subject: Hi
I have tried just about EVERYTHING to get a body in the message, trying Body:, Text:, and Message:, placing these under or after the Subject: (Subject: works fine by the way)
any ideas?
-
presumably you've read through the documentation for MSMTP? http://msmtp.sourceforge.net/doc/msmtp.html (http://msmtp.sourceforge.net/doc/msmtp.html) and tried
--help
FB
-
yes. MSMTP appears to be designed as a replacement for the program that sends your email normally, i.e., it is designed to be used with annother program, like Mutt. And the documentation contains NO information on using MSMTP, just configuring it! Gack!
-
I'm confused do you still need us?
FB
-
err, yes, I read the docs before posting. they provide NO information on using the app, only on configuring it. I need to know how to use MSMTP from the command line or a batch script. I can get it to send and email with a subject but not with a body. If there is another command line app that can send though a Gmail account, I'll switch to it if it is better.
-
Then sorry i don't think i can help you, though i'm not sure DOS is the best place to look for support... try over in software.
FB
-
spent a few days on this one. stick a blank line in your file between subject and the message body.
Subject: my subject
body starts here
line 2
end of body
-
yes, it is very useful to send mails as commandline form. and it works as a blank between the subject and other contents. but there still a problem, i cannot found a way to attach additional files when using msmtp.
-
i cannot found a way to attach additional files when using msmtp.
Can be done by encoding with base64
-
i finally found a better way to send mail at command line
ehco 'mail content' | mutt -s 'subject' -a additionalFileName [email protected]
-
FWIW, I've used blat for years to send mail from a script. It works great
Development seems to have slowed, but it is very mature
http://www.blat.net/
\\uSlackr