Come spedire email da prompt dos
Da molto tempo uso questo splendido (e gratuito) programma che manda mail da prompt dos per spedirmi i log dei server 2000/2003 ogni notte.
Tutte le notti faccio il dump dei log dei server in file di testo e me li faccio spedire ad un indirizzo email specifico per questo compito, cosi’ evito di andare a ravanare uno per uno le varie macchine poste anche in sedi remote.
Questo e’ l’elenco delle funzioni del programma che si puo’ scaricare da http:/www.blat.net
Blat v1.8.9: WinNT/95 console utility to mail a file via SMTP
by P.Mendes, M.Neal, G.Vollant, T. Charron
http://www.blat.net
syntax:
Blat <filename> -to <recipient> [optional switches (see below)]
Blat -install <server addr> <sender’s addr> [<try>[<port>[<profile>]]] [-q]
Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q]
Blat -h [-q]
-install <server addr> <sender’s addr> [<try n times> [<port> [<profile>]]]
: set’s SMTP server, sender, number of tries and port for profile
(<try n times> and <port> may be replaced by ‘-’).
<filename> : file with the message body (‘-’ for console input, end with ^Z)
-to <recipient> : recipient list (also -t) (comma separated)
-tf <recipient> : recipient list filename
-subject <subj>: subject line (also -s)
-f <sender> : overrides the default sender address (must be known to server)
-i <addr> : a ‘From:’ address, not necessarily known to the SMTP server.
-cc <recipient>: carbon copy recipient list (also -c) (comma separated)
-cf <file> : cc recipient list filename
-bcc <recipient>: blind carbon copy recipient list (also -bcc) (comma separated)
-bf <file> : bcc recipient list filename
-organization <organization>: Organization field (also -o and -org)
-body <text> : Message body
-x <X-Header: detail>: Custom ‘X-’ header. eg: -x “X-INFO: Blat is Great!”
-r : Request return receipt.
-d : Request disposition notification.
-h : displays this help.
-q : supresses *all* output.
-debug : Echoes server communications to screen (disables ‘-q’).
-noh : prevent X-Mailer header from showing homepage of blat
-noh2 : prevent X-Mailer header entirely
-p <profile> : send with SMTP server, user and port defined in <profile>.
-server <addr> : Specify SMTP server to be used. (optionally, addr:port)
-port <port> : port to be used on the server, defaults to SMTP (25)
-hostname <hst>: select the hostname used to send the message
-mime : MIME Quoted-Printable Content-Transfer-Encoding.
-enriched : Send an enriched text message (Content-Type=text/enriched)
-html : Send an HTML message (Content-Type=text/html)
-uuencode : Send (binary) file UUEncoded
-base64 : Send (binary) file using base64 (binary Mime)
-try <n times> : how many time blat should try to send. from ‘1′ to ‘INFINITE’
-attach <file> : attach binary file to message (may be repeated)
-attacht <file>: attach text file to message (may be repeated)
-ti <n> : Set timeout to ‘n’ seconds.
-u <username> : Username for AUTH LOGIN (use with -pw)
-pw <password> : Password for AUTH LOGIN (use with -u)
-log <filename>: Log everything but usage to <filname>
-plain : Use AUTH PLAIN to login to SMTP server (use with -u -pw)
Note that if the ‘-i’ option is used, <sender> is included in ‘Reply-to:’
and ‘Sender:’ fields in the header of the message.
Optionally, the following options can be used instead of the -f and -i
options:
-mailfrom <addr> The RFC 821 MAIL From: statement
-from <addr> The RFC 822 From: statement
-replyto <addr> The RFC 822 Reply-To: statement
-returnpath <addr> The RFC 822 Return-Path: statement
-sender <addr> The RFC 822 Sender: statement
For backward consistency, the -f and -i options have precedence over these
RFC 822 defined options. If both -f and -i options are omitted then the
RFC 821 MAIL FROM statement will be defaulted to use the installation-defined
default sender address
Come potete vdere alle opzioni non manca nulla
Come spedire email da prompt dos…
Da molto tempo uso questo splendido (e gratuito) programma che manda mail da prompt dos per spedirmi i log dei server 2000/2003 ogni notte….
[...] blat è un programma che permette di inviare da prompt di dos un’e-mail, esattamente come se lo si facesse da client di posta in ambiente grafico. [...]
E’ un po’ come tornare indietro nel tempo…. certo se hai fretta o la tastiera non è il tuo “campo” è un ostico come tool
ciao
Non e’ ostico, e’ un tool fatto per un’esigenza specifica…
Ovvio che non lo uso per mandare le mail agli amici…
perchè non usare più semplicemente SMTP per spedire i log?
Perche’ dovrei installare 15 server smtp su 15 macchine quando posso usare il mio server di posta aziendale ? sono tutti windows e non nascono con postfix o exim gia’ in pancia…
ciao scusa ma a me non funziona
(meglio mi ha funzionato un paio di volte e basta)
il server devo metterne uno a caso ?
smtp.aruba.it va bene ?
ho il sito e l’e-mail su aruba
se faccio
blat testo.txt -install smtp.aruba.it -to mybox@trtfnc.it
non mi funziona
poi la password e l’id quale devo mettere ?
grazie …
Un qualche errore lo rende ? “Non funziona” non e’ sufficente come analisi del problema, a tutto il resto del mondo si…
scusa, intanto grazie per avermi risposto
io somo un po’ rookie
se faccio
blat testo.txt -install smtp.aruba.it -f mybox@trtfnc.it
-pw _____ -to tartarini1970@jumpy.it
mi da
smtp server set to smpt.aruba.it on port tartarini1970@jumpy.it wuth user mybox@trtfnc.it,
retry -to time(s)
l’avere scelto un server smtp ha un senso ???
o devo scegliere il mio ???
ciao
Io uso, per farti un esempio, una cosa come questa
blat invio -to destinatario@mailserver.it -server smtp.mailserver.it -f mittente@mailserver.it -subject “server 01 – logs di sistema” -attach logtxt.rar
dove invio e’ un file di testo che contiente il corpo dell’email, il resto sono varie opzioni.
Comunque secondo me il problema e’ i lserver di smtp che usi, forse vuole la validazione ? Leggi l’help di blat, c’e’ il modo di farsi anche autenticare…
Ciao ho provato il blat su diversi pc, usando lo stesso metodo ma non capisco perchè su alcuni mi da “error connection refused” e su altri mi funziona perfettamente. su 2 pc con vista tutto ok, su 4 xp 2vanno e 2 mi danno l’errore.
Qualcuno mi sa dire se gli è capitato e come l’ha risolto?
Secodo me dipende dal fatto che il server di posta non accetta la spedizione senza autenticazione.
Ha un client di posta su quelle machcine ? Come le spedisce le email ?
Prova eventualmente a mettere altri due parametri:
-u : Username for AUTH LOGIN (use with -pw) : Password for AUTH LOGIN (use with -u)
-pw
grazie per la risposta, scusa non ho precisato ma la prova l’ho fatta dalla stessa rete adsl con tutte le macchine, le email vengono spedite in tutti i pc con microsoft outlook con il valore smtp out.alice.it senza problemi e non richiede autenticazione. E’ questo che non riesco a capire,sulla stessa linea alcuni vanno e altri no
Secondo google non sei il solo ad avere questo problema, ma putroppo non ho trovato soluzioni…
Scusate se mi intrometto, ma come si fa a lanciare un dump in automatico?
Ho fatto un piccolo file bat, ma mi chiede sempre la password da prompt. Come faccio a fargliela mangiare per esempio da un file di testo?
Scusatemi
Imbranato
Come posso far leggere in input da un file .txt o .csv gli account contenuti per invio multiplo con blat??
grazie
Dalle istruzioni del programma credo che non si possa.
Perchè non mandi un’mail al programmatore, magare prende in considerazione l’idea e la mette nella prossima release.
Ciao… cortesemente potresti controllare dove sbaglio?
@COPY blat.exe C:\WINDOWS\system32\blat.exe
@COPY blat.dll C:\WINDOWS\system32\blat.dll
@COPY blat.lib C:\WINDOWS\system32\blat.lib
@blat -install out.alice.it MIAEMAILALICE@alice.it
cls
@blat C:\Documents and Settings\%USERNAME%\Desktop\prova.txt -to MIAMAILVIRGILIO@virgilio.it
ovviamente i caratteri scritti in grassetto li sostituisco…
Ho provato a cambiare gli indirizzi email lasciando l’SMPT alice e poi cambiando anche quello, ho provato a mettere la vera username al posto di %USERNAME% (che è un comando universale e che ho provato personalmente che funziona) ma niente…
I tre file li copia in c\system32 ma non mi arriva nessuna mail, su nessu indirizzo… logicamente sul desktop c’è davvero un file “prova.txt”
Ho provato anche a prelevare un “prova.html” credendo che fosse il tipo di file il problema ma niente… quando lancio a mano il file .bat non mi da errori, mi copia i file e in un attimo si chiude da solo.
Spero che avrai modo di aiutarmi…
Bluesrumba…!
Sei sicuro che
C:\Documents and Settings\%USERNAME%\Desktop\prova.txt
senza le virgolette te lo prende ? secondo me si ferma a
C:\Documents
prova a mettere cosi
“C:\Documents and Settings\%USERNAME%\Desktop\prova.txt”
e vedi se esce