gudfry Posted August 15, 2008 Share Posted August 15, 2008 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. 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->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, Quote aWarning: mail() [function.mail]: SMTP server response: 503 valid RCPT command must precede DATA in F:\Progrm Files please help me to fixed this error. regards to all, Quote Link to comment https://forums.phpfreaks.com/topic/119788-solved-need-help-send-email-problem/ Share on other sites More sharing options...
Kieran Menor Posted August 15, 2008 Share Posted August 15, 2008 Did you remember to specify a correct e-mail address for $email? If my logic is correct, RCPT means recipient. Quote Link to comment https://forums.phpfreaks.com/topic/119788-solved-need-help-send-email-problem/#findComment-617142 Share on other sites More sharing options...
gudfry Posted August 15, 2008 Author Share Posted August 15, 2008 thank you so much, but yes I'am already put the RCPT email id, but its desame; Quote Link to comment https://forums.phpfreaks.com/topic/119788-solved-need-help-send-email-problem/#findComment-617147 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.