API15:JMail/useSMTP
From Joomla! Documentation
Description
Use SMTP for sending the e-mail
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
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 | $secure SMTP Secure ssl,tls [optinal] |
| $port | 25 | $port SMTP Port [optional] |
Returns
boolean True on success
Defined in
libraries/joomla/mail/mail.php
Importing
jimport( 'joomla.mail.mail' );
Source Body
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
Code Examples