Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

send mail batch windows

  • 6 trả lời
  • 1 gặp vấn đề này
  • 6 lượt xem
  • Trả lời mới nhất được viết bởi 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?

Tất cả các câu trả lời (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

Được chỉnh sửa bởi Gnospen vào