Jump to content

[SOLVED] need help, send email problem!!!


gudfry

Recommended Posts

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,

 

    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,

Link to comment
https://forums.phpfreaks.com/topic/119788-solved-need-help-send-email-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.