JMail/useSMTP: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m preparing for archive only |
||
| Line 75: | Line 75: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=useSMTP | category=useSMTP | ||
category=JMail | category=JMail | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 00:57, 25 March 2017
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