hi,
these codes are from wingate2.tcl by bass, which emails the loged host to the specify email address, but somehow these are not working, i'll appreciate for your help.
set wingate(mail-log) wingates.log
set wingate(mail-to) "" ;# add your email addy here
bind time - "03 22 * * *" wingate_mail
proc wingate_mail {a b c d e} {
global wingate
if {![file exists $wingate(mail-log)]} {return 0}
if {[expr $c/7] != [expr $c/7.]} {return 0}
if {$wingate(mail-to) != ""} {
foreach i [split $wingate(mail-to) ,] {
catch {exec cat $wingate(mail-log) | sendmail $i}
}
catch {exec rm -f $wingate(mail-log).old}
catch {exec cp $wingate(mail-log) $wingate(mail-log).old}
catch {exec rm -f $wingate(mail-log)}
}
}
Thanks, ppslim
yeap, email address is there, and its logging to the file in the wingate(mail-log) as well, how do i fix this, so it can send a file 3:00am daily?? plz
should i remove this line
if {[expr $c/7] != [expr $c/7.]} {return 0}
and bind time - "03 22 * * *" wingate_mail to
bind time - "* 03 * * *" wingate_mail
i am still not getting an email, email address is there, its logging to the file...ok
also i have done few tests n i can see in a bot dir, its swaping files fine, but not sending an email....
ok it worked when i chnage "sendmail" to "mail"..cos sendmail is not install on my shell..
but it not sending file as an attachement, just simple email, how do i send a file as an attachement?
You will have to encode the text being sent, to a type that is used to send attachments, then you will need to format the e-mail body, to accept sending an attachment.