hi all;
suposed to be this question has been solve, perhaps sory if i need to ask again.I found a code of send and email using with php classes; but there is something wrong with it.
here is the whole code.
class request {
var $email;
var $senderName;
var $senderPhone;
var $senderEmail;
var $senderSubject;
var $senderMessage;
var $returnEmail;
var $header;
var $type = "text/plain";
var $characterSet = "iso-8859-1";
function createHeader() {
$from = "From: $this->senderName <$this->senderEmail>\r\n";
$returnEmail = "Reply-To: $this->returnEmail\r\n";
$params = "MIME-Version: 1.0\r\n";
$params .= "Content-type: $this->type; charset=$this->characterSet\r\n";
$this->header = $from.$returnEmail.$params;
return $this->header;
}
function sendEmail(){
$this->createHeader();
@mail($this->email,$this->senderSubject,$this->senderMessage,$this->header);
}
}
$mail = new request();
$mail->email = $_POST['email'];
$mail->senderName = $_POST['senderName'];
$mail->senderEmail = $_POST['senderEmail'];
$mail->senderPhone = $_POST['senderPhone'];
$mail->senderSubject = $_POST['senderSubject'];
$mail->senderMessage = $_POST['senderMessage'];
if ($mail->sendEmail()) {
echo "Thanks for your message!";
} else {
echo "Sending email was failed!";
}
when i run this code. there is an error on the screen,
Warning: mail() [function.mail]: SMTP server response: 503 valid RCPT command must precede DATA in F:\Program Files
please help me to fixed this error. regards to all,