[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Mail/ -> Mail.php (summary)

Joomla! Content Management System

Copyright: (C) 2006 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 668 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Mail:: (19 methods):
  __construct()
  getInstance()
  Send()
  setSender()
  setSubject()
  setBody()
  add()
  addRecipient()
  addCc()
  addBcc()
  addAttachment()
  clearAttachments()
  removeAttachment()
  addReplyTo()
  isHtml()
  isSendmail()
  useSendmail()
  useSmtp()
  sendMail()


Class: Mail  - X-Ref

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

__construct($exceptions = true)   X-Ref
Constructor

param: boolean  $exceptions  Flag if Exceptions should be thrown

getInstance($id = 'Joomla', $exceptions = true)   X-Ref
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: string   $id          The id string for the Mail instance [optional]
param: boolean  $exceptions  Flag if Exceptions should be thrown [optional]
return: Mail  The global Mail object

Send()   X-Ref
Send the mail

return: boolean  Boolean true if successful, false if exception throwing is disabled.

setSender($from)   X-Ref
Set the email sender

param: mixed  $from  email address and Name of sender
return: Mail|boolean  Returns this object for chaining on success or boolean false on failure.

setSubject($subject)   X-Ref
Set the email subject

param: string  $subject  Subject of the email
return: Mail  Returns this object for chaining.

setBody($content)   X-Ref
Set the email body

param: string  $content  Body of the email
return: Mail  Returns this object for chaining.

add($recipient, $name = '', $method = 'addAddress')   X-Ref
Add recipients to the email.

param: mixed   $recipient  Either a string or array of strings [email address(es)]
param: mixed   $name       Either a string or array of strings [name(s)]
param: string  $method     The parent method's name.
return: Mail|boolean  Returns this object for chaining on success or boolean false on failure.

addRecipient($recipient, $name = '')   X-Ref
Add recipients to the email

param: mixed  $recipient  Either a string or array of strings [email address(es)]
param: mixed  $name       Either a string or array of strings [name(s)]
return: Mail|boolean  Returns this object for chaining on success or false on failure when exception throwing is disabled.

addCc($cc, $name = '')   X-Ref
Add carbon copy recipients to the email

param: mixed  $cc    Either a string or array of strings [email address(es)]
param: mixed  $name  Either a string or array of strings [name(s)]
return: Mail|boolean  Returns this object for chaining on success or boolean false on failure when exception throwing is enabled.

addBcc($bcc, $name = '')   X-Ref
Add blind carbon copy recipients to the email

param: mixed  $bcc   Either a string or array of strings [email address(es)]
param: mixed  $name  Either a string or array of strings [name(s)]
return: Mail|boolean  Returns this object for chaining on success or boolean false on failure when exception throwing is disabled.

addAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream', $disposition = 'attachment')   X-Ref
Add file attachment to the email

param: mixed   $path         Either a string or array of strings [filenames]
param: mixed   $name         Either a string or array of strings [names]. N.B. if this is an array it must contain the same
param: mixed   $encoding     The encoding of the attachment
param: mixed   $type         The mime type
param: string  $disposition  The disposition of the attachment
return: Mail|boolean  Returns this object for chaining on success or boolean false on failure when exception throwing is disabled.

clearAttachments()   X-Ref
Unset all file attachments from the email

return: Mail  Returns this object for chaining.

removeAttachment($index = 0)   X-Ref
Unset file attachments specified by array index.

param: integer  $index  The numerical index of the attachment to remove
return: Mail  Returns this object for chaining.

addReplyTo($replyto, $name = '')   X-Ref
Add Reply to email address(es) to the email

param: mixed  $replyto  Either a string or array of strings [email address(es)]
param: mixed  $name     Either a string or array of strings [name(s)]
return: Mail|boolean  Returns this object for chaining on success or boolean false on failure when exception throwing is disabled.

isHtml($ishtml = true)   X-Ref
Sets message type to HTML

param: boolean  $ishtml  Boolean true or false.
return: Mail  Returns this object for chaining.

isSendmail()   X-Ref
Send messages using $Sendmail.

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

return: void

useSendmail($sendmail = null)   X-Ref
Use sendmail for sending the email

param: string  $sendmail  Path to sendmail [optional]
return: boolean  True on success

useSmtp($auth = null, $host = null, $user = null, $pass = null, $secure = null, $port = 25)   X-Ref
Use SMTP for sending the email

param: string   $auth    SMTP Authentication [optional]
param: string   $host    SMTP Host [optional]
param: string   $user    SMTP Username [optional]
param: string   $pass    SMTP Password [optional]
param: string   $secure  Use secure methods
param: integer  $port    The SMTP port
return: boolean  True on success

sendMail($from,$fromName,$recipient,$subject,$body,$mode = false,$cc = null,$bcc = null,$attachment = null,$replyTo = null,$replyToName = null)   X-Ref
Function to send an email

param: string   $from         From email address
param: string   $fromName     From name
param: mixed    $recipient    Recipient email address(es)
param: string   $subject      email subject
param: string   $body         Message body
param: boolean  $mode         false = plain text, true = HTML
param: mixed    $cc           CC email address(es)
param: mixed    $bcc          BCC email address(es)
param: mixed    $attachment   Attachment file name(s)
param: mixed    $replyTo      Reply to email address(es)
param: mixed    $replyToName  Reply to name(s)
return: boolean  True on success, false on failure when exception throwing is disabled.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer