need help sending email from php

This is a discussion on need help sending email from php within the PHP Language forums, part of the PHP Programming Forums category; I'm trying to send email from a php script (not my code) and the mail is being rejected by ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-17-2005
Dave Calhoun
 
Posts: n/a
Default need help sending email from php

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;
}
}

}
Reply With Quote
  #2 (permalink)  
Old 06-17-2005
NC
 
Posts: n/a
Default Re: need help sending email from php

Dave Calhoun wrote:
>
> 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.


Replace every occurrence of "\n" with "\r\n" and see if
it solves the problem.

Cheers,
NC

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0