We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

send mail batch windows

  • 6 回覆
  • 1 有這個問題
  • 6 次檢視
  • 最近回覆由 Gnospen

more options

I'd like to be able to send a email from a batch file under windows. I created a bat file containing the following...

start "sendmail" /B thunderbird.exe -compose "to=xyz@abc.edu,subject=alert,body=Message_Body"

Running that opens a window with the proper to, subject, and body but I have to manually close the window. Is there some way to completely automate this process?

I'd like to be able to send a email from a batch file under windows. I created a bat file containing the following... start "sendmail" /B thunderbird.exe -compose "to=xyz@abc.edu,subject=alert,body=Message_Body" Running that opens a window with the proper to, subject, and body but I have to manually close the window. Is there some way to completely automate this process?

所有回覆 (6)

more options

Maybee there is a way. If not:

I needed the same function and found Blat on sourgeforge sending to a SMTP-server I named at install. My batch-code: START /wait /min BLAT %body% -to %sendto% -sender %sender% -subject %subj% -log %txt% -overwritelog

more options

I did consider blat but then you need something like stunnel for the secure socket layer and that needs .... Other folks run my stuff and I'd prefer that they not have to load a bunch of other stuff.

more options

I hope someone has an answer. I assume it's just sending ctrl+enter or "sendnow". I searched for it then and search for it now (as you must have done) In all of my hits they complained about having to press enter to send.

more options

Thanks for the help. I did stumble upon the following items

http://forums.mozillazine.org/viewtopic.php?f=39&t=540783 http://forums.mozillazine.org/viewtopic.php?t=203591 https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-options

The script in the first does seem to work BUT I have been unable to figure out how to include attachments. I know little about VB but the mixture of chr(34) (" I assume) and " seems very weird. Also the discrepancy between "mailto" and "to" between the first and third reference is troubling.

Here's what I have tried.

dim s Set s = CreateObject("WScript.Shell") s.run """thunderbird.exe""" & " -compose mailto:xxxx@xxx.edu? &subject=""send mail 3""&body=""nice body text""&attachment='file:///c:/Documents and Settings/Mike/My Documents/sendmail/vb/msg.txt'" WScript.Sleep 1000 s.SendKeys "^{ENTER}" WScript.Sleep 1000

This composes and sends an email BUT without the attachment. I have tried both single and double quotes around the file name.

more options

The mystery deepens. If I specify a non-existent file as the attachment, the email is composed but not sent automatically.

more options

Edit didn't work either way. But mine got thru even if it was a non existing file. NO response to &attachment even if its in the same directory as mailbatch

由 Gnospen 於 修改