Re: как работает команда mail?
17 мая 2010 г. 13:18 пользователь Roman Cheplyaka
<roman.cheplyaka@tmassive.com> написал:
> А что, mutt умеет кодировки в неинтерактивном режиме?
"Не вижу препятствий".
.muttrc (урезан для краткости):
unmy_hdr *
set charset="UTF-8"
set send_charset="UTF-8"
set content_type="text/html"
Собственно сам код скрипта (Tcl):
# отправка печатной формы заявки, если ее удалось создать, и
приложенных файлов, если они есть
set subj "Document N=$document_id UUID=$uuid"
if {[catch {
if {$files ne {}} {
set cmd [list mutt -s $subj -F .muttrc -a {*}$files -- {*}$mailto]
} else {
set cmd [list mutt -s $subj -F .muttrc -- {*}$mailto]
puts "Document $document_id will be send but it's empty"
}
set io [open |$cmd r+]
fconfigure $io -encoding utf-8
puts $io $comment
close $io
puts "Document $document_id is sent"
} msg]} {
puts "Document $document_id send error"
puts stderr ">>>ERROR\n$msg\n<<<ERROR"
}
--
Best regards, Alexey Pechnikov.
http://pechnikov.tel/
Reply to: