Last month I've written an article on Minulý mesiac som napísal článok o executing any file when application crashed or stopped running uskutočnením akéhokoľvek súboru pri použití havaroval alebo zastavil prevádzku . . All I need is a small portable software that monitors for a process availability. Všetko, čo potrebujete, je malá prenosná softvér, ktorý monitoruje proces dostupnosť. When the process crashed, the monitoring software will automatically run a batch file containing a few more commands to run. Keď proces havaroval, softvér pre monitorovanie sa automaticky spustí dávkový súbor, ktorý obsahuje niekoľko príkazov pre spustenie. A game server with intensive mod can cause daily random crashes and it's important to make sure that it auto restarts the game server when that happens. Herný server s intenzívnym mod môže spôsobiť denne náhodné zlyhanie a je dôležité, aby sa ubezpečil, že to automaticky reštartuje herný server, keď sa to stane. So far everything is working as expected except it'd have been better if I can include an email or SMS notification when the server crashes. Zatiaľ všetko funguje podľa očakávania až na to už bolo lepšie, keby som môžu obsahovať e-mail alebo SMS upozornenie, keď server zrúti.
Command line email blat
In order to do that, I found a small portable tool called Blat which can send an email using command line. Na tento účel sa, že som našiel malý prenosný nástroj nazývaný Blat, ktoré dokáže odoslať e-mail z príkazového riadku. Blat is a Win32 command line utility that sends eMail using SMTP or post to usenet using NNTP. Blat je Win32 command line nástroj, ktorý posiela e-mailu cez SMTP alebo poštou na adresu Usenet pomocou protokolu NNTP. Command line application is very different from graphical user interface (GUI). Command line aplikácie je veľmi odlišná od grafického užívateľského rozhrania (GUI). In programs with GUI, there are buttons and boxes for you to enter the details but for command line, everything must be typed out in a single line. V aplikáciách s GUI, sú tlačidlá a boxy pre vás na zadanie podrobností, ale pre príkazový riadok, musí všetko byť uzavretý v jednej línii. It's not so user friendly but very flexible. To nie je tak užívateľsky prívetivý, ale veľmi flexibilné.

To use Blat to send email, you will definitely need to refer to the Ak chcete použiť Blat poslať e-mail, budete určite potrebovať odkázať na syntax syntax manual. manuál. Below is an example for a normal SMTP server that requires authentication. Nižšie je uvedený príklad pre normálne SMTP server, ktorý vyžaduje overenie. You can also use IP:Port for -server syntax. Môžete tiež použiť IP: Port pre-server syntax. By default Blat uses port 25 but if your SMTP server uses a different port, then you can change it. V predvolenom nastavení Blat používa port 25, ale ak váš SMTP server používa iný port, môžete zmeniť.

blat.exe -f from@email.com -to recipient@email.com -subject ThisIsTheSubject -body ThisIsTheBody -server smtp.server.com:25 -u SMTPUserLogin -pw SMTPUserPass blat.exe from@email.com-f-k-recipient @ email.com predmet ThisIsTheSubject-body ThisIsTheBody-server smtp.server.com: 25-u-SMTPUserLogin pw SMTPUserPass

Using the command line above, I will receive an email notification alert whenever the server goes down. Použitie príkazového riadku vyššie, budem dostávať oznámenia emailom upozornenia vždy, keď server spadne. If I want to receive it in a form of SMS on my mobile, I will need subscribe “email to SMS” service from Ak budem chcieť, aby ho dostali vo forme SMS na môj mobil, budem musieť objednať "e-mail na SMS" služby, od Clickatell Clickatell , , World-Text World-Text or any other provider that offers such service. alebo iného poskytovateľa, ktorý ponúka takéto služby.

There hasn't been any updates on Blat for more than 2 years but I can verify that it works without any problems on my webhosting SMTP server. Nedošlo k žiadnej aktuálne informácie o Blat pre viac ako 2 roky, ale môžem overiť, že to funguje bez problémov na môj webhosting SMTP servera. However I don't think you can use Gmail, Hotmail, and Yahoo SMTP to send out email because this 3 email service requires SSL and I can't find this option in Blat. Avšak ja si nemyslím, že môžete používať Gmail, Hotmail, Yahoo a SMTP posielať e-mailom, pretože to 3 e-mailových služieb si vyžaduje SSL a nemôžem nájsť túto možnosť v Blat. You can try Môžete skúsiť SendEmail SendEmail which supports TLS but you will first need to install the ktorý podporuje TLS, ale budete musieť najprv nainštalovať Net::SSLeay and IO::Socket::SSL Net:: SSLeay a IO:: Socket:: SSL perl modules on Windows. perl moduly pre Windows.

[ [ Visit Blat Official Homepage Navštívte Blat Oficiálna stránka ] ]

Technorati Tags: Technorati Tags: , , , , , , , ,