Forum OpenACS Q&A: Response to ns_sendmail and utf-8

Collapse
Posted by MaineBob OConnor on

Hi Reuven,

This is not a direct answer but it may get you headed down the right path. I've had problems with sendmail and line feeds in the output.... SEE this discussion:

ns_sendmail CR/LF lost in some messages

In particular see where I solve the problem on Oct 15th in the last post.

Also, I have used this enhanced code for sending email:

set x_head [ns_set create]
ns_set update $x_head "Errors-To" "errors@rocnet.com"
ns_set update $x_head "MIME-Version" "1.0"
ns_set update $x_head "Content-Type" "text/plain;
     charset="iso-8859-1""
ns_set update $x_head "Content-Transfer-Encoding" "8bit"

...

  regsub -all "
" $body2 "" body2

  if [catch {
     ns_sendmail $email $my_email $subject $body2 $x_head
     } errmsg] {
           ns_log Notice "EMail Failure: $email 
 Error: $errmsg"
     } else {
       ns_write "$count
" }

Good Luck
-Bob

REF: https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0002jp