Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Mail
+ Graphe d'héritage de Mail:

Fonctions membres publiques

 Send ()
 
 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)
 
- 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='')
 
 setFrom ($address, $name='', $auto=true)
 
 getLastMessageID ()
 
 punyencodeAddress ($address)
 
 send ()
 
 preSend ()
 
 postSend ()
 
 getSMTPInstance ()
 
 setSMTPInstance (SMTP $smtp)
 
 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=self::ENCODING_BASE64, $type='', $disposition='attachment')
 
 getAttachments ()
 
 encodeString ($str, $encoding=self::ENCODING_BASE64)
 
 encodeHeader ($str, $position='text')
 
 hasMultiBytes ($str)
 
 has8bitChars ($text)
 
 base64EncodeWrapMB ($str, $linebreak=null)
 
 encodeQP ($string)
 
 encodeQ ($str, $position='text')
 
 addStringAttachment ( $string, $filename, $encoding=self::ENCODING_BASE64, $type='', $disposition='attachment')
 
 addEmbeddedImage ( $path, $cid, $name='', $encoding=self::ENCODING_BASE64, $type='', $disposition='inline')
 
 addStringEmbeddedImage ( $string, $cid, $name='', $encoding=self::ENCODING_BASE64, $type='', $disposition='inline')
 
 inlineImageExists ()
 
 attachmentExists ()
 
 alternativeExists ()
 
 clearQueuedAddresses ($kind)
 
 clearAddresses ()
 
 clearCCs ()
 
 clearBCCs ()
 
 clearReplyTos ()
 
 clearAllRecipients ()
 
 clearAttachments ()
 
 clearCustomHeaders ()
 
 isError ()
 
 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)
 
 getToAddresses ()
 
 getCcAddresses ()
 
 getBccAddresses ()
 
 getReplyToAddresses ()
 
 getAllRecipientAddresses ()
 
 getOAuth ()
 
 setOAuth (OAuthTokenProvider $oauth)
 

Fonctions membres publiques statiques

static getInstance ($id='Joomla', $exceptions=true)
 
- Fonctions membres publiques statiques hérités de PHPMailer
static parseAddresses ($addrstr, $useimap=true, $charset=self::CHARSET_ISO88591)
 
static validateAddress ($address, $patternselect=null)
 
static idnSupported ()
 
static rfcDate ()
 
static isValidHost ($host)
 
static _mime_types ($ext='')
 
static filenameToType ($filename)
 
static mb_pathinfo ($path, $options=null)
 
static normalizeBreaks ($text, $breaktype=null)
 
static stripTrailingWSP ($text)
 
static getLE ()
 
static hasLineLongerThanMax ($str)
 
static quotedString ($str)
 

Champs de données

 $CharSet = 'utf-8'
 
- Champs de données hérités de PHPMailer
const CHARSET_ASCII = 'us-ascii'
 
const CHARSET_ISO88591 = 'iso-8859-1'
 
const CHARSET_UTF8 = 'utf-8'
 
const CONTENT_TYPE_PLAINTEXT = 'text/plain'
 
const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar'
 
const CONTENT_TYPE_TEXT_HTML = 'text/html'
 
const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'
 
const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed'
 
const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related'
 
const ENCODING_7BIT = '7bit'
 
const ENCODING_8BIT = '8bit'
 
const ENCODING_BASE64 = 'base64'
 
const ENCODING_BINARY = 'binary'
 
const ENCODING_QUOTED_PRINTABLE = 'quoted-printable'
 
const ENCRYPTION_STARTTLS = 'tls'
 
const ENCRYPTION_SMTPS = 'ssl'
 
const ICAL_METHOD_REQUEST = 'REQUEST'
 
const ICAL_METHOD_PUBLISH = 'PUBLISH'
 
const ICAL_METHOD_REPLY = 'REPLY'
 
const ICAL_METHOD_ADD = 'ADD'
 
const ICAL_METHOD_CANCEL = 'CANCEL'
 
const ICAL_METHOD_REFRESH = 'REFRESH'
 
const ICAL_METHOD_COUNTER = 'COUNTER'
 
const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER'
 
 $Priority
 
 $CharSet = self::CHARSET_ISO88591
 
 $ContentType = self::CONTENT_TYPE_PLAINTEXT
 
 $Encoding = self::ENCODING_8BIT
 
 $ErrorInfo = ''
 
 $From = ''
 
 $FromName = ''
 
 $Sender = ''
 
 $Subject = ''
 
 $Body = ''
 
 $AltBody = ''
 
 $Ical = ''
 
 $WordWrap = 0
 
 $Mailer = 'mail'
 
 $Sendmail = '/usr/sbin/sendmail'
 
 $UseSendmailOptions = true
 
 $ConfirmReadingTo = ''
 
 $Hostname = ''
 
 $MessageID = ''
 
 $MessageDate = ''
 
 $Host = 'localhost'
 
 $Port = 25
 
 $Helo = ''
 
 $SMTPSecure = ''
 
 $SMTPAutoTLS = true
 
 $SMTPAuth = false
 
 $SMTPOptions = []
 
 $Username = ''
 
 $Password = ''
 
 $AuthType = ''
 
 $Timeout = 300
 
 $dsn = ''
 
 $SMTPDebug = 0
 
 $Debugoutput = 'echo'
 
 $SMTPKeepAlive = false
 
 $SingleTo = false
 
 $do_verp = false
 
 $AllowEmpty = false
 
 $DKIM_selector = ''
 
 $DKIM_identity = ''
 
 $DKIM_passphrase = ''
 
 $DKIM_domain = ''
 
 $DKIM_copyHeaderFields = true
 
 $DKIM_extraHeaders = []
 
 $DKIM_private = ''
 
 $DKIM_private_string = ''
 
 $action_function = ''
 
 $XMailer = ''
 
const VERSION = '6.6.0'
 
const STOP_MESSAGE = 0
 
const STOP_CONTINUE = 1
 
const STOP_CRITICAL = 2
 
const CRLF = "\r\n"
 
const FWS = ' '
 
const MAIL_MAX_LINE_LENGTH = 63
 
const MAX_LINE_LENGTH = 998
 
const STD_LINE_LENGTH = 76
 

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=self::ENCODING_BASE64)
 
 validateEncoding ($encoding)
 
 cidExists ($cid)
 
 setError ($msg)
 
 serverHostname ()
 
 lang ($key)
 
 doCallback ($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra)
 

Attributs protégés statiques

static $instances = array()
 
- Attributs protégés statiques hérités de PHPMailer
static $IcalMethods
 
static $LE = self::CRLF
 

Membres hérités additionnels

- Attributs publics statiques hérités de PHPMailer
static $validator = 'php'
 
- Fonctions membres protégées statiques hérités de PHPMailer
static isShellSafe ($string)
 
static isPermittedPath ($path)
 
static fileIsAccessible ($path)
 
static setLE ($le)
 
- Attributs protégés hérités de PHPMailer
 $MIMEBody = ''
 
 $MIMEHeader = ''
 
 $mailHeader = ''
 
 $oauth
 
 $SingleToArray = []
 
 $smtp
 
 $to = []
 
 $cc = []
 
 $bcc = []
 
 $ReplyTo = []
 
 $all_recipients = []
 
 $RecipientsQueue = []
 
 $ReplyToQueue = []
 
 $attachment = []
 
 $CustomHeader = []
 
 $lastMessageID = ''
 
 $message_type = ''
 
 $boundary = []
 
 $language = []
 
 $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 $method, $name, $this, PHPMailer\$to, et MailHelper\cleanLine().

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 when exception throwing is disabled.
Depuis
3.0.1
Exceptions

Références $key, $name, $path, $result, $this, et $type.

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 when exception throwing is disabled.
Depuis
1.7.0
Exceptions
phpmailerExceptionif exception throwing is enabled

Références PHPMailer\$bcc, $name, $this, 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 when exception throwing is enabled.
Depuis
1.7.0
Exceptions
phpmailerExceptionif exception throwing is enabled

Références PHPMailer\$cc, $name, $this, 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 on success or false on failure when exception throwing is disabled.
Depuis
1.7.0
Exceptions
phpmailerExceptionif exception throwing is enabled

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

Référencé par 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 when exception throwing is disabled.
Depuis
1.7.0
Exceptions
phpmailerExceptionif exception throwing is enabled

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

Références $this.

◆ 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érences $this.

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\getApplication().

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

Références $this.

◆ Send()

Send ( )

Send the mail

Renvoie
boolean Boolean true if successful, false if exception throwing is disabled.
Depuis
1.7.0
Exceptions
MailDisabledExceptionif the mail function is disabled
phpmailerExceptionif sending failed

Références $result, Text\_(), Factory\getApplication(), MailDisabledException\REASON_MAIL_FUNCTION_NOT_AVAILABLE, et MailDisabledException\REASON_USER_DISABLED.

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

◆ 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, false on failure when exception throwing is disabled.
Depuis
1.7.0
Exceptions
MailDisabledExceptionif the mail function is disabled
phpmailerExceptionif exception throwing is enabled

Références $app, PHPMailer\$attachment, PHPMailer\$bcc, PHPMailer\$cc, $i, $mode, $subject, Mail\addAttachment(), Mail\addBcc(), Mail\addCc(), Mail\addRecipient(), Mail\addReplyTo(), elseif, Factory\getApplication(), 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, $this, et MailHelper\cleanText().

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

◆ 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 $result, $this, Log\add(), MailHelper\cleanLine(), elseif, PHPMailer\setFrom(), Text\sprintf(), 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, $this, et MailHelper\cleanLine().

Référencé par 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 :