sendmail_proc - a procedure for sending mail using smtp.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | proc sendSimpleMessage {email_address subject body} {
puts "\n*** sendSimpleMessage proc ***\n"
package require smtp
package require mime
set emailServer your.email.server
puts "\nemail address: $email_address"
puts "subject: $subject"
puts "body: $body"
puts "email_server: $emailServer\n"
set computer_name $::env(COMPUTERNAME)
set message [mime::initialize -canonical text/plain -file $body]
smtp::sendmessage $message -servers $emailServer \
-header [list To $email_address] \
-header [list From $computer_name] \
-header [list Subject $subject]
mime::finalize $message
}
|
Tags: windows