|  | Posted by Dave Calhoun on 06/17/05 02:41 
I'm trying to send email from a php script (not my code) and the mail is being rejected by my isp's qmail server. It says that I have illegal
 crcr's where I should have crlf's. I'm not sure what to do. Here is the
 code if it gives any clues. Also, if someone could enlighten me on how
 those $this-> lines work I'd appreciate it.
 
 Thanks for any help.
 Dave
 
 
 
 function send() {
 global $language;
 if (empty($this->to) || empty($this->from)) {
 return false;
 }
 if (isset($_SESSION["tp"]->email_prefix) &&
 !empty($_SESSION["tp"]->email_prefix)) {
 $this->subject = '['.$_SESSION["tp"]->email_prefix.']
 '.$this->subject;
 }
 $cc = "";
 if (!empty($this->cc)) {
 $cc = "Cc: ".$this->cc."\n";
 }
 $bcc = "";
 if (!empty($this->bcc)) {
 $bcc = "Bcc: ".$this->bcc."\n";
 }
 if (empty($this->reply_to)) {
 $this->reply_to = $this->from;
 $this->reply_to_name = $this->from_name;
 }
 if (empty($this->charset)) {
 $this->charset = $language->charset;
 }
 //$body  =~ s/\r\r/\r\f/g, $body;
 
 
 
 
 $sent = mail($this->to
 ,$this->subject
 ,$this->body
 ,'From: "'.$this->from_name.'" <'.$this->from.'>'."\n"
 .'Reply-To: "'.$this->reply_to_name.'"
 <'.$this->reply_to.'>'."\n"
 .'Return-Path: "'.$this->reply_to_name.'"
 <'.$this->reply_to.'>'."\n"
 .$cc
 .$bcc
 .'Date: '.date('r')."\n"
 .'Content-Type: text/plain;
 charset='.$this->charset."\n.\n"
 );
 
 if ($sent != false) {
 return true;
 }
 else {
 return false;
 }
 }
 
 }
  Navigation: [Reply to this message] |