Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe Mail
+ Graphe d'héritage de Mail:

Fonctions membres publiques

 Send ()
 
 setFrom ($address, $name='', $auto=true)
 
 setSender ($from)
 
 setSubject ($subject)
 
 setBody ($content)
 
 addRecipient ($recipient, $name='')
 
 addCc ($cc, $name='')
 
 addBcc ($bcc, $name='')
 
 addAttachment ($path, $name='', $encoding='base64', $type='application/octet-stream', $disposition='attachment')
 
 clearAttachments ()
 
 removeAttachment ($index=0)
 
 addReplyTo ($replyto, $name='')
 
 isHtml ($ishtml=true)
 
 isSendmail ()
 
 useSendmail ($sendmail=null)
 
 useSmtp ($auth=null, $host=null, $user=null, $pass=null, $secure=null, $port=25)
 
 sendMail ($from, $fromName, $recipient, $subject, $body, $mode=false, $cc=null, $bcc=null, $attachment=null, $replyTo=null, $replyToName=null)
 
 sendAdminMail ($adminName, $adminEmail, $email, $type, $title, $author, $url=null)
 
- Fonctions membres publiques hérités de PHPMailer
 __construct ($exceptions=null)
 
 __destruct ()
 
 isHTML ($isHtml=true)
 
 isSMTP ()
 
 isMail ()
 
 isSendmail ()
 
 isQmail ()
 
 addAddress ($address, $name='')
 
 addCC ($address, $name='')
 
 addBCC ($address, $name='')
 
 addReplyTo ($address, $name='')
 
 parseAddresses ($addrstr, $useimap=true)
 
 setFrom ($address, $name='', $auto=true)
 
 getLastMessageID ()
 
 idnSupported ()
 
 punyencodeAddress ($address)
 
 send ()
 
 preSend ()
 
 postSend ()
 
 getSMTPInstance ()
 
 smtpConnect ($options=null)
 
 smtpClose ()
 
 setLanguage ($langcode='en', $lang_path='')
 
 getTranslations ()
 
 addrAppend ($type, $addr)
 
 addrFormat ($addr)
 
 wrapText ($message, $length, $qp_mode=false)
 
 utf8CharBoundary ($encodedText, $maxLength)
 
 setWordWrap ()
 
 createHeader ()
 
 getMailMIME ()
 
 getSentMIMEMessage ()
 
 createBody ()
 
 headerLine ($name, $value)
 
 textLine ($value)
 
 addAttachment ($path, $name='', $encoding='base64', $type='', $disposition='attachment')
 
 getAttachments ()
 
 encodeString ($str, $encoding='base64')
 
 encodeHeader ($str, $position='text')
 
 hasMultiBytes ($str)
 
 has8bitChars ($text)
 
 base64EncodeWrapMB ($str, $linebreak=null)
 
 encodeQP ($string, $line_max=76)
 
 encodeQPphp ( $string, $line_max=76, $space_conv=false)
 
 encodeQ ($str, $position='text')
 
 addStringAttachment ( $string, $filename, $encoding='base64', $type='', $disposition='attachment')
 
 addEmbeddedImage ($path, $cid, $name='', $encoding='base64', $type='', $disposition='inline')
 
 addStringEmbeddedImage ( $string, $cid, $name='', $encoding='base64', $type='', $disposition='inline')
 
 inlineImageExists ()
 
 attachmentExists ()
 
 alternativeExists ()
 
 clearQueuedAddresses ($kind)
 
 clearAddresses ()
 
 clearCCs ()
 
 clearBCCs ()
 
 clearReplyTos ()
 
 clearAllRecipients ()
 
 clearAttachments ()
 
 clearCustomHeaders ()
 
 isError ()
 
 fixEOL ($str)
 
 addCustomHeader ($name, $value=null)
 
 getCustomHeaders ()
 
 msgHTML ($message, $basedir='', $advanced=false)
 
 html2text ($html, $advanced=false)
 
 set ($name, $value='')
 
 secureHeader ($str)
 
 sign ($cert_filename, $key_filename, $key_pass, $extracerts_filename='')
 
 DKIM_QP ($txt)
 
 DKIM_Sign ($signHeader)
 
 DKIM_HeaderC ($signHeader)
 
 DKIM_BodyC ($body)
 
 DKIM_Add ($headers_line, $subject, $body)
 
 quotedString ($str)
 
 getToAddresses ()
 
 getCcAddresses ()
 
 getBccAddresses ()
 
 getReplyToAddresses ()
 
 getAllRecipientAddresses ()
 

Fonctions membres publiques statiques

static getInstance ($id='Joomla', $exceptions=true)
 
- Fonctions membres publiques statiques hérités de PHPMailer
static validateAddress ($address, $patternselect=null)
 
static rfcDate ()
 
static _mime_types ($ext='')
 
static filenameToType ($filename)
 
static mb_pathinfo ($path, $options=null)
 
static normalizeBreaks ($text, $breaktype="\")
 
static hasLineLongerThanMax ($str)
 

Champs de données

 $CharSet = 'utf-8'
 
- Champs de données hérités de PHPMailer
 $Version = '5.2.28+joomla2'
 
 $Priority = null
 
 $CharSet = 'iso-8859-1'
 
 $ContentType = 'text/plain'
 
 $Encoding = '8bit'
 
 $ErrorInfo = ''
 
 $From = 'root@localhost'
 
 $FromName = 'Root User'
 
 $Sender = ''
 
 $ReturnPath = ''
 
 $Subject = ''
 
 $Body = ''
 
 $AltBody = ''
 
 $Ical = ''
 
 $WordWrap = 0
 
 $Mailer = 'mail'
 
 $Sendmail = '/usr/sbin/sendmail'
 
 $UseSendmailOptions = true
 
 $PluginDir = ''
 
 $ConfirmReadingTo = ''
 
 $Hostname = ''
 
 $MessageID = ''
 
 $MessageDate = ''
 
 $Host = 'localhost'
 
 $Port = 25
 
 $Helo = ''
 
 $SMTPSecure = ''
 
 $SMTPAutoTLS = true
 
 $SMTPAuth = false
 
 $SMTPOptions = array()
 
 $Username = ''
 
 $Password = ''
 
 $AuthType = ''
 
 $Realm = ''
 
 $Workstation = ''
 
 $Timeout = 300
 
 $SMTPDebug = 0
 
 $Debugoutput = 'echo'
 
 $SMTPKeepAlive = false
 
 $SingleTo = false
 
 $SingleToArray = array()
 
 $do_verp = false
 
 $AllowEmpty = false
 
 $LE = "\n"
 
 $DKIM_selector = ''
 
 $DKIM_identity = ''
 
 $DKIM_passphrase = ''
 
 $DKIM_domain = ''
 
 $DKIM_private = ''
 
 $DKIM_private_string = ''
 
 $action_function = ''
 
 $XMailer = ''
 
const STOP_MESSAGE = 0
 
const STOP_CONTINUE = 1
 
const STOP_CRITICAL = 2
 
const CRLF = "\r\n"
 
const MAX_LINE_LENGTH = 998
 

Fonctions membres protégées

 add ($recipient, $name='', $method='addAddress')
 
- Fonctions membres protégées hérités de PHPMailer
 edebug ($str)
 
 addOrEnqueueAnAddress ($kind, $address, $name)
 
 addAnAddress ($kind, $address, $name='')
 
 sendmailSend ($header, $body)
 
 mailSend ($header, $body)
 
 smtpSend ($header, $body)
 
 generateId ()
 
 getBoundary ($boundary, $charSet, $contentType, $encoding)
 
 endBoundary ($boundary)
 
 setMessageType ()
 
 attachAll ($disposition_type, $boundary)
 
 encodeFile ($path, $encoding='base64')
 
 setError ($msg)
 
 serverHostname ()
 
 lang ($key)
 
 doCallback ($isSent, $to, $cc, $bcc, $subject, $body, $from)
 

Attributs protégés statiques

static $instances = array()
 

Membres hérités additionnels

- Attributs publics statiques hérités de PHPMailer
static $validator = 'auto'
 
- Fonctions membres protégées statiques hérités de PHPMailer
static isShellSafe ($string)
 
static isPermittedPath ($path)
 
- Attributs protégés hérités de PHPMailer
 $MIMEBody = ''
 
 $MIMEHeader = ''
 
 $mailHeader = ''
 
 $smtp = null
 
 $to = array()
 
 $cc = array()
 
 $bcc = array()
 
 $ReplyTo = array()
 
 $all_recipients = array()
 
 $RecipientsQueue = array()
 
 $ReplyToQueue = array()
 
 $attachment = array()
 
 $CustomHeader = array()
 
 $lastMessageID = ''
 
 $message_type = ''
 
 $boundary = array()
 
 $language = array()
 
 $error_count = 0
 
 $sign_cert_file = ''
 
 $sign_key_file = ''
 
 $sign_extracerts_file = ''
 
 $sign_key_pass = ''
 
 $exceptions = false
 
 $uniqueid = ''
 

Description détaillée

Email Class. Provides a common interface to send email from the Joomla! Platform

Depuis
1.7.0

Documentation des fonctions membres

◆ add()

add (   $recipient,
  $name = '',
  $method = 'addAddress' 
)
protected

Add recipients to the email.

Paramètres
mixed$recipientEither a string or array of strings [email address(es)]
mixed$nameEither a string or array of strings [name(s)]
string$methodThe parent method's name.
Renvoie
Mail|boolean Returns this object for chaining on success or boolean false on failure.
Depuis
1.7.0
Exceptions

Références $name, PHPMailer\$to, Log\add(), MailHelper\cleanLine(), et Log\WARNING.

Référencé par Mail\addBcc(), Mail\addCc(), Mail\addRecipient(), et Mail\addReplyTo().

◆ addAttachment()

addAttachment (   $path,
  $name = '',
  $encoding = 'base64',
  $type = 'application/octet-stream',
  $disposition = 'attachment' 
)

Add file attachment to the email

Paramètres
mixed$pathEither a string or array of strings [filenames]
mixed$nameEither a string or array of strings [names]. N.B. if this is an array it must contain the same number of elements as the array of paths supplied.
mixed$encodingThe encoding of the attachment
mixed$typeThe mime type
string$dispositionThe disposition of the attachment
Renvoie
Mail|boolean Returns this object for chaining on success or boolean false on failure.
Depuis
3.0.1
Exceptions

Références $file, $key, $name, $path, $type, Log\add(), et Log\WARNING.

Référencé par Mail\sendMail().

◆ addBcc()

addBcc (   $bcc,
  $name = '' 
)

Add blind carbon copy recipients to the email

Paramètres
mixed$bccEither a string or array of strings [email address(es)]
mixed$nameEither a string or array of strings [name(s)]
Renvoie
Mail|boolean Returns this object for chaining on success or boolean false on failure.
Depuis
1.7.0

Références PHPMailer\$bcc, $name, et Mail\add().

Référencé par Mail\sendMail().

◆ addCc()

addCc (   $cc,
  $name = '' 
)

Add carbon copy recipients to the email

Paramètres
mixed$ccEither a string or array of strings [email address(es)]
mixed$nameEither a string or array of strings [name(s)]
Renvoie
Mail|boolean Returns this object for chaining on success or boolean false on failure.
Depuis
1.7.0

Références PHPMailer\$cc, $name, et Mail\add().

Référencé par Mail\sendMail().

◆ addRecipient()

addRecipient (   $recipient,
  $name = '' 
)

Add recipients to the email

Paramètres
mixed$recipientEither a string or array of strings [email address(es)]
mixed$nameEither a string or array of strings [name(s)]
Renvoie
Mail|boolean Returns this object for chaining.
Depuis
1.7.0

Références $name, et Mail\add().

Référencé par Mail\sendAdminMail(), et Mail\sendMail().

◆ addReplyTo()

addReplyTo (   $replyto,
  $name = '' 
)

Add Reply to email address(es) to the email

Paramètres
mixed$replytoEither a string or array of strings [email address(es)]
mixed$nameEither a string or array of strings [name(s)]
Renvoie
Mail|boolean Returns this object for chaining on success or boolean false on failure.
Depuis
1.7.0

Références $name, et Mail\add().

Référencé par Mail\sendMail().

◆ clearAttachments()

clearAttachments ( )

Unset all file attachments from the email

Renvoie
Mail Returns this object for chaining.
Depuis
3.0.1

◆ getInstance()

static getInstance (   $id = 'Joomla',
  $exceptions = true 
)
static

Returns the global email object, only creating it if it doesn't already exist.

NOTE: If you need an instance to use that does not have the global configuration values, use an id string that is not 'Joomla'.

Paramètres
string$idThe id string for the Mail instance [optional]
boolean$exceptionsFlag if Exceptions should be thrown [optional]
Renvoie
Mail The global Mail object
Depuis
1.7.0

Références PHPMailer\$exceptions, et $id.

Référencé par Factory\createMailer().

◆ isHtml()

isHtml (   $ishtml = true)

Sets message type to HTML

Paramètres
boolean$ishtmlBoolean true or false.
Renvoie
Mail Returns this object for chaining.
Depuis
3.1.4

Référencé par Mail\sendMail().

◆ isSendmail()

isSendmail ( )

Send messages using $Sendmail.

This overrides the parent class to remove the restriction on the executable's name containing the word "sendmail"

Renvoie
void
Depuis
1.7.0

Références Factory\getConfig().

Référencé par Mail\useSendmail().

◆ removeAttachment()

removeAttachment (   $index = 0)

Unset file attachments specified by array index.

Paramètres
integer$indexThe numerical index of the attachment to remove
Renvoie
Mail Returns this object for chaining.
Depuis
3.0.1

◆ Send()

Send ( )

Send the mail

Renvoie
boolean| Boolean true if successful, boolean false if the mailonline configuration is set to 0, or a JException object if the mail function does not exist or sending the message fails.
Depuis
1.7.0
Exceptions

PHPMailer has an issue with servers with invalid certificates

See: https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#opportunistic-tls

Références Factory\getApplication(), Factory\getConfig(), et JError\raiseNotice().

Référencé par Mail\sendAdminMail(), et Mail\sendMail().

◆ sendAdminMail()

sendAdminMail (   $adminName,
  $adminEmail,
  $email,
  $type,
  $title,
  $author,
  $url = null 
)

Sends mail to administrator for approval of a user submission

Paramètres
string$adminNameName of administrator
string$adminEmailEmail address of administrator
string$email[NOT USED TODO: Deprecate?]
string$typeType of item to approve
string$titleTitle of item to approve
string$authorAuthor of item to approve
string$urlA URL to included in the mail
Renvoie
boolean True on success
Depuis
1.7.0
Obsolète:
4.0 Without replacement please implement it in your own code

Références $author, $message, $subject, $title, $type, $url, Mail\addRecipient(), Mail\Send(), Mail\setBody(), et Mail\setSubject().

◆ sendMail()

sendMail (   $from,
  $fromName,
  $recipient,
  $subject,
  $body,
  $mode = false,
  $cc = null,
  $bcc = null,
  $attachment = null,
  $replyTo = null,
  $replyToName = null 
)

Function to send an email

Paramètres
string$fromFrom email address
string$fromNameFrom name
mixed$recipientRecipient email address(es)
string$subjectemail subject
string$bodyMessage body
boolean$modefalse = plain text, true = HTML
mixed$ccCC email address(es)
mixed$bccBCC email address(es)
mixed$attachmentAttachment file name(s)
mixed$replyToReply to email address(es)
mixed$replyToNameReply to name(s)
Renvoie
boolean True on success
Depuis
1.7.0

Références PHPMailer\$attachment, PHPMailer\$bcc, PHPMailer\$cc, $config, $i, $mode, $subject, Mail\addAttachment(), Mail\addBcc(), Mail\addCc(), Mail\addRecipient(), Mail\addReplyTo(), elseif, Factory\getConfig(), Mail\isHtml(), Mail\Send(), Mail\setBody(), Mail\setSender(), et Mail\setSubject().

◆ setBody()

setBody (   $content)

Set the email body

Paramètres
string$contentBody of the email
Renvoie
Mail Returns this object for chaining.
Depuis
1.7.0

Références $content, et MailHelper\cleanText().

Référencé par Mail\sendAdminMail(), et Mail\sendMail().

◆ setFrom()

setFrom (   $address,
  $name = '',
  $auto = true 
)

Set the From and FromName properties.

Paramètres
string$addressThe sender email address
string$nameThe sender name
boolean$autoWhether to also set the Sender address, defaults to true
Renvoie
boolean
Depuis
1.7.0

Références $name, Log\add(), et Log\WARNING.

Référencé par Mail\setSender().

◆ setSender()

setSender (   $from)

Set the email sender

Paramètres
mixed$fromemail address and Name of sender array([0] => email Address, [1] => Name) or as a string
Renvoie
Mail|boolean Returns this object for chaining on success or boolean false on failure.
Depuis
1.7.0
Exceptions

Références Log\add(), MailHelper\cleanLine(), elseif, Mail\setFrom(), et Log\WARNING.

Référencé par Mail\sendMail().

◆ setSubject()

setSubject (   $subject)

Set the email subject

Paramètres
string$subjectSubject of the email
Renvoie
Mail Returns this object for chaining.
Depuis
1.7.0

Références $subject, et MailHelper\cleanLine().

Référencé par Mail\sendAdminMail(), et Mail\sendMail().

◆ useSendmail()

useSendmail (   $sendmail = null)

Use sendmail for sending the email

Paramètres
string$sendmailPath to sendmail [optional]
Renvoie
boolean True on success
Depuis
1.7.0

Références PHPMailer\isMail(), et Mail\isSendmail().

◆ useSmtp()

useSmtp (   $auth = null,
  $host = null,
  $user = null,
  $pass = null,
  $secure = null,
  $port = 25 
)

Use SMTP for sending the email

Paramètres
string$authSMTP Authentication [optional]
string$hostSMTP Host [optional]
string$userSMTP Username [optional]
string$passSMTP Password [optional]
string$secureUse secure methods
integer$portThe SMTP port
Renvoie
boolean True on success
Depuis
1.7.0

Références $user, PHPMailer\isMail(), PHPMailer\isSMTP(), et null.

Documentation des champs

◆ $CharSet

$CharSet = 'utf-8'

◆ $instances

$instances = array()
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :