connected example

default:
                    $sendMethod = $this->Mailer . 'Send';
                    if (method_exists($this$sendMethod)) {
                        return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody);
                    }

                    return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
            }
        } catch (Exception $exc) {
            $this->setError($exc->getMessage());
            $this->edebug($exc->getMessage());
            if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) {
                $this->smtp->reset();
            }
            if ($this->exceptions) {
                throw $exc;
            }
        }

        return false;
    }

    /** * Send mail using the $Sendmail program. * * @see PHPMailer::$Sendmail * * @param string $header The message headers * @param string $body The message body * * @throws Exception * * @return bool */

    public function connect($host$port = null, $timeout = 30, $options = [])
    {
        //Clear errors to avoid confusion         $this->setError('');
        //Make sure we are __not__ connected         if ($this->connected()) {
            //Already connected, generate error             $this->setError('Already connected to a server');

            return false;
        }
        if (empty($port)) {
            $port = self::DEFAULT_PORT;
        }
        //Connect to the SMTP server         $this->edebug(
            "Connection: opening to $host:$port, timeout=$timeout, options=" .
            (
Home | Imprint | This part of the site doesn't use cookies.