Actions

API16

JMail/useSMTP

From Joomla! Documentation

< API16:JMail
Revision as of 17:54, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Use SMTP for sending the e-mail

[Edit Descripton]

Description:JMail/useSMTP

Syntax

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
$port 25

Returns

boolean True on success

Defined in

libraries/joomla/mail/mail.php

Importing

jimport( 'joomla.mail.mail' );

Source Body

public 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();
                return true;
        } else {
                $this->IsMail();
                return false;
        }
}

[Edit See Also] SeeAlso:JMail/useSMTP

Examples

<CodeExamplesForm />