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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.