if {[catch [exec -- echo "Subject: $email_subject\n." | sendmail $email_addresses] cerr]} { # put error messages into the process standard log echo "$module ERROR: *****************************************************" echo "$module ERROR: email/Page attempt of:" echo "$module ERROR: >$email_subject$email_addresses$email_subject$email_addresses<" puts stderr "$module ERROR: failed!" flush stderr return $msgval }
system "echo "Subject: $email_subject\n." | sendmail $email_addresses"
proc penrad_cmax_mail { psmsg body } { package require mime package require smtp set fp [open report.ps w] puts -nonewline $fp $psmsg close $fp exec ksh -c "unset SHLIB_PATH; gs -sDEVICE=pdfwrite -sOutputFile=report.pdf report.ps < /dev/null" set psmsg [read_file report.pdf] # create an image and text set psT [mime::initialize -canonical "application/pdf; name="report.pdf"" -string $psmsg] set textT [mime::initialize -canonical text/plain -string $body] # create a multipart containing both, and a timestamp set multiT [mime::initialize -canonical multipart/mixed -parts [list $psT $textT]] # call Sendmail to deliver the message set rcpt [list "zzzzz@valleymed.org" "xxxxx@valleymed.org" "david_barr@valleymed.org"] set rcpt2 [join $rcpt " "] set fp [open "|/usr/sbin/sendmail $rcpt2" w] puts $fp "To: [join $rcpt ,]" puts $fp "From: "VMC.QDX Integrator production mode." " puts $fp "Subject: error processing report from Penrad" #Date: Wed, 02 Mar 2008 16:34:00 -0700 puts $fp [::mime::buildmessage $multiT] close $fp# The following code works from a standalone script, but not from# within a cloverleaf process. In the future, I'd like to try to get# this working.## smtp::sendmessage $multiT # -header [list To "David_Barr@valleymed.org"] # -header [list Subject "error processing report from Penrad"] # -servers { borderware.valleymed.net } # -header [list From "David_Barr@valleymed.org"]}
Originally posted by Scott Folley
Kevin Crist wrote:Thanks all. I actually got this working, pretty cool. But i have one more question...since these are charge codes that come from our patient accts, at the end of year they send out lots of changes, maybe in the thousands, will this cause any performance issues sending out many emails like this? This only happens at year end and the rest of the time they just trickle down.
Kevin Crist wrote:
Originally posted by Terry Kellum
set recipientList [list bob@fred.com jeff@fred.com]set smtpSnd cloverleaf@fred.comset smtpServ emailServer.fred.com# write header stuffmime::setheader $multiT From "$smtpSnd"mime::setheader $multiT To [join $recipientList ,]mime::setheader $multiT Subject "Your Subject Here"# send the message - I use catch to protect from any unhandled errorscatch {smtp::sendmessage $multiT -recipients [join $recipientList ,] -servers $smtpServ -atleastone 1}# destroy the message catch {mime::finalize $multiT}
exec mailx -r zorgdomein_no_reply@orbisconcern.nl -s "${subject}" ${email} < ${filename}