Jump to content

Probblem smtpResponse si mail::$localdomain


Recommended Posts

Hellow guys,i get this error when i want to change my password by send e-mail,can i get some help here ?

smtpResponse error:

Notice: Undefined variable: smtpResponse in /home/metindi3/public_html/site/asg_functions/mail_class.php on line 179

this is line 179:

$this->logArray['connection'] = "Connection accepted: $smtpResponse";

localdomain error:

Notice: Undefined property: Mail::$localdomain in /home/metindi3/public_html/site/asg_functions/mail_class.php on line 187

this is line 187:

$this->sendCommand("EHLO $this->localdomain");

Thank you!

 

Link to comment
Share on other sites

Notice: Undefined variable: smtpResponse in /home/metindi3/public_html/site/asg_functions/mail_class.php on line 179
this is line 179:

This is no error, this is a notice. Its not that bad as it looks. This Notice said just that the variable $smtpResponse is undefined. You can declare your Variable by using an if condition right before line 179:

$smtpResponse = isset($smtpResponse) ? $smtpResponse : 'No SMTP Response given.';

This should do the magic. Im sure that this message is just for your logs so its ok like this.

-------------------------------------------

Notice: Undefined property: Mail::$localdomain in /home/metindi3/public_html/site/asg_functions/mail_class.php on line 187

This is a notice, too. Try it with brackets (this is required when calling a function)

$this->sendCommand("EHLO $this->localdomain()");

If this is not working, show me your public function localdomain() { /* .... */ } in your mail_class.php file (hope the function naming is right). Maybe there is a getLocaldomain() function?

 

btw. if this is a production server you should disable notice messages for security reasons (after fixing the problem) globally with 

error_reporting(E_ERROR | E_WARNING | E_PARSE);

 

  • Love 1
Link to comment
Share on other sites

3 hours ago, Ayaka said:

Notice: Undefined property: Mail::$localdomain in /home/metindi3/public_html/site/asg_functions/mail_class.php on line 187

This is a notice, too. Try it with brackets (this is required when calling a function)


$this->sendCommand("EHLO $this->localdomain()");

If this is not working, show me your public function localdomain() { /* .... */ } in your mail_class.php file (hope the function naming is right). Maybe there is a getLocaldomain() function?

 

Yep,this not working,but smtp working :D whatt i have in mail_class it's a function but inside is that lines with localdomain and smtp.Thank you!Look down :

 

    private function Connect2Server() {



        // Connect to server



        $this->smtpConnect = fsockopen($this->smtpServer,$this->port,$errno,$error,$this->timeout);



        $this->logArray['CONNECT_RESPONSE'] = $this->readResponse();







        if (!is_resource($this->smtpConnect)) {



            return false;



        }



		$smtpResponse = isset($smtpResponse) ? $smtpResponse : 'No SMTP Response given.';
        $this->logArray['connection'] = "Connection accepted: $smtpResponse";



        // Hi, server!



        $this->sendCommand("EHLO $this->localdomain()");



        $this->logArray['EHLO'] = $this->readResponse();



        // Let's know each other



        $this->sendCommand('AUTH LOGIN');



        $this->logArray['AUTH_REQUEST'] = $this->readResponse();



        // My name...



        $this->sendCommand(base64_encode($this->username));



        $this->logArray['REQUEST_USER'] = $this->readResponse();



        // My password..



        $this->sendCommand(base64_encode($this->password));



        $this->logArray['REQUEST_PASSWD'] = $this->readResponse();



        // If error in response auth...



        if (substr($this->logArray['REQUEST_PASSWD'],0,3)!='235') {



            $this->Error .= 'Authorization error! '.$this->logArray['REQUEST_PASSWD'].$this->newline;



            return false;



        }



        // "From" mail...



        $this->sendCommand("MAIL FROM: $this->username");



        $this->logArray['MAIL_FROM_RESPONSE'] = $this->readResponse();



        if (substr($this->logArray['MAIL_FROM_RESPONSE'],0,3)!='250') {



            $this->Error .= 'Mistake in sender\'s address! '.$this->logArray['MAIL_FROM_RESPONSE'].$this->newline;



            return false;



        }



        // "To" address



        $this->sendCommand("RCPT TO: $this->to");



        $this->logArray['RCPT_TO_RESPONCE'] = $this->readResponse();



        if (substr($this->logArray['RCPT_TO_RESPONCE'],0,3)!='250') {



            $this->Error .= 'Mistake in reciepent address! '.$this->logArray['RCPT_TO_RESPONCE'].$this->newline;



        }



        // Send data to server



        $this->sendCommand('DATA');



        $this->logArray['DATA_RESPONSE'] = $this->readResponse();



        // Send mail message



        if (!$this->sendMail()) return false;



        // Good bye server! =)



        $this->sendCommand('QUIT');



        $this->logArray['QUIT_RESPONSE'] = $this->readResponse();



        // Close smtp connect 



        fclose($this->smtpConnect);



        return true;



    }

 

Link to comment
Share on other sites

ah understand. You try to get a EHLO for only logging this respond infromations. Its not important but you can fix it if you give $localdomain a value: Search your whole php files for:

private $localdomain

If you found the right file you have to enter the link from your site like this:

private $localdomain = 'http://www.yourmt2server.com';

---

if you dont really need this loginformation you can comment it:

// Hi, server!
// $this->sendCommand("EHLO $this->localdomain()");
// $this->logArray['EHLO'] = $this->readResponse();

 

  • Love 1
Link to comment
Share on other sites

Then your SMTP authorization login informations are wrong. The SMTP Server want to connect but your authorization data is wrong. You have to find where then login infromations are stored. If you are finding the $localdomain variable you're find the other too.

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.