API15

JMail/useSMTP

From Joomla! Documentation

< API15:JMail

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Use SMTP for sending the e-mail

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax[edit]

useSMTP($auth=null, $host=null, $user=null, $pass=null, $secure=null, $port=25)
Parameter Name Default Value Description
$auth null $auth SMTP Authentication [optional]
$host null $host SMTP Host [optional]
$user null $user SMTP Username [optional]
$pass null $pass SMTP Password [optional]
$secure null $secure SMTP Secure ssl,tls [optinal]
$port 25 $port SMTP Port [optional]

Returns[edit]

boolean True on success

Defined in[edit]

libraries/joomla/mail/mail.php

Importing[edit]

jimport( 'joomla.mail.mail' );

Source Body[edit]

function useSMTP($auth = null, $host = null, $user = null, $pass = null,$secure = null, $port = 25)
{
        $this->SMTPAuth = $auth;
        $this->Host     = $host;
        $this->Username = $user;
        $this->Password = $pass;
        $this->Port     = $port;
        if ($secure == 'ssl' || $secure == 'tls') {
                $this->SMTPSecure = $secure;
        }

        if ($this->SMTPAuth !== null && $this->Host !== null && $this->Username !== null && $this->Password !== null) {
                $this->IsSMTP();
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

Code Examples[edit]