Class JMail

Description

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

  • since: 11.1

Located in /libraries/joomla/mail/mail.php (line 21)

PHPMailer
   |
   --JMail
Variable Summary
 static array $instances
 string $CharSet
Method Summary
 static JMail getInstance ([string $id = 'Joomla'])
 JMail __construct ()
 JMail add (mixed $recipient, [mixed $name = ''], [string $method = 'AddAddress'])
 JMail addAttachment (mixed $attachment, [mixed $name = ''], [mixed $encoding = 'base64'], [mixed $type = 'application/octet-stream'])
 JMail addBCC (mixed $bcc, [mixed $name = ''])
 JMail addCC (mixed $cc, [mixed $name = ''])
 JMail addRecipient (mixed $recipient, [mixed $name = ''])
 JMail addReplyTo (mixed $replyto, [mixed $name = ''])
 JMail isHtml ([boolean $ishtml = true])
 mixed Send ()
 boolean sendAdminMail (string $adminName, string $adminEmail, string $email, string $type, string $title, string $author, [string $url = null])
 boolean sendMail (string $from, string $fromName, mixed $recipient, string $subject, string $body, [boolean $mode = false], [mixed $cc = null], [mixed $bcc = null], [mixed $attachment = null], [mixed $replyTo = null], [mixed $replyToName = null])
 JMail setBody (string $content)
 JMail setSender (mixed $from)
 JMail setSubject (string $subject)
 boolean useSendmail ([string $sendmail = null])
 boolean useSMTP ([string $auth = null], [string $host = null], [string $user = null], [string $pass = null], [string $secure = null], [integer $port = 25])
Variables
static array $instances = array() (line 27)
  • var: JMail instances container.
  • since: 11.3
  • access: protected
string $CharSet = 'utf-8' (line 33)
  • var: Charset of the message.
  • since: 11.1
  • access: public

Redefinition of:
PHPMailer::$CharSet
Sets the CharSet of the message.

Inherited Variables

Inherited from PHPMailer

PHPMailer::$action_function
PHPMailer::$AllowEmpty
PHPMailer::$all_recipients
PHPMailer::$AltBody
PHPMailer::$attachment
PHPMailer::$AuthType
PHPMailer::$bcc
PHPMailer::$Body
PHPMailer::$boundary
PHPMailer::$cc
PHPMailer::$ConfirmReadingTo
PHPMailer::$ContentType
PHPMailer::$CustomHeader
PHPMailer::$Debugoutput
PHPMailer::$DKIM_domain
PHPMailer::$DKIM_identity
PHPMailer::$DKIM_passphrase
PHPMailer::$DKIM_private
PHPMailer::$DKIM_selector
PHPMailer::$do_verp
PHPMailer::$Encoding
PHPMailer::$ErrorInfo
PHPMailer::$error_count
PHPMailer::$exceptions
PHPMailer::$From
PHPMailer::$FromName
PHPMailer::$Helo
PHPMailer::$Host
PHPMailer::$Hostname
PHPMailer::$Ical
PHPMailer::$language
PHPMailer::$LE
PHPMailer::$Mailer
PHPMailer::$mailHeader
PHPMailer::$MessageDate
PHPMailer::$MessageID
PHPMailer::$message_type
PHPMailer::$MIMEBody
PHPMailer::$MIMEHeader
PHPMailer::$Password
PHPMailer::$PluginDir
PHPMailer::$Port
PHPMailer::$Priority
PHPMailer::$Realm
PHPMailer::$ReplyTo
PHPMailer::$ReturnPath
PHPMailer::$Sender
PHPMailer::$Sendmail
PHPMailer::$sign_cert_file
PHPMailer::$sign_key_file
PHPMailer::$sign_key_pass
PHPMailer::$SingleTo
PHPMailer::$SingleToArray
PHPMailer::$smtp
PHPMailer::$SMTPAuth
PHPMailer::$SMTPDebug
PHPMailer::$SMTPKeepAlive
PHPMailer::$SMTPSecure
PHPMailer::$Subject
PHPMailer::$Timeout
PHPMailer::$to
PHPMailer::$Username
PHPMailer::$UseSendmailOptions
PHPMailer::$Version
PHPMailer::$WordWrap
PHPMailer::$Workstation
PHPMailer::$XMailer
Methods
static getInstance (line 59)

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'.

  • return: The global JMail object
  • since: 11.1
  • access: public
static JMail getInstance ([string $id = 'Joomla'])
  • string $id: The id string for the JMail instance [optional]
Constructor __construct (line 40)

Constructor

  • since: 11.1
  • access: public
JMail __construct ()

Redefinition of:
PHPMailer::__construct()
Constructor
add (line 208)

Add recipients to the email.

  • return: Returns this object for chaining.
  • since: 11.1
  • throws: InvalidArgumentException
  • access: protected
JMail add (mixed $recipient, [mixed $name = ''], [string $method = 'AddAddress'])
  • mixed $recipient: Either a string or array of strings [email address(es)]
  • mixed $name: Either a string or array of strings [name(s)]
  • string $method: The parent method's name.
addAttachment (line 321)

Add file attachments to the email

  • return: Returns this object for chaining.
  • since: 12.2
  • throws: InvalidArgumentException
  • access: public
JMail addAttachment (mixed $attachment, [mixed $name = ''], [mixed $encoding = 'base64'], [mixed $type = 'application/octet-stream'])
  • mixed $attachment: Either a string or array of strings [filenames]
  • mixed $name: Either a string or array of strings [names]
  • mixed $encoding: The encoding of the attachment
  • mixed $type: The mime type
addBCC (line 297)

Add blind carbon copy recipients to the email

  • return: Returns this object for chaining.
  • since: 11.1
  • access: public
JMail addBCC (mixed $bcc, [mixed $name = ''])
  • mixed $bcc: Either a string or array of strings [email address(es)]
  • mixed $name: Either a string or array of strings [name(s)]
addCC (line 276)

Add carbon copy recipients to the email

  • return: Returns this object for chaining.
  • since: 11.1
  • access: public
JMail addCC (mixed $cc, [mixed $name = ''])
  • mixed $cc: Either a string or array of strings [email address(es)]
  • mixed $name: Either a string or array of strings [name(s)]
addRecipient (line 259)

Add recipients to the email

  • return: Returns this object for chaining.
  • since: 11.1
  • access: public
JMail addRecipient (mixed $recipient, [mixed $name = ''])
  • mixed $recipient: Either a string or array of strings [email address(es)]
  • mixed $name: Either a string or array of strings [name(s)]
addReplyTo (line 364)

Add Reply to email address(es) to the email

  • return: Returns this object for chaining.
  • since: 11.1
  • access: public
JMail addReplyTo (mixed $replyto, [mixed $name = ''])
  • mixed $replyto: Either a string or array of strings [email address(es)]
  • mixed $name: Either a string or array of strings [name(s)]
isHtml (line 380)

Sets message type to HTML

  • return: Returns this object for chaining.
  • since: 12.3
  • access: public
JMail isHtml ([boolean $ishtml = true])
  • boolean $ishtml: Boolean true or false.
Send (line 77)

Send the mail

  • return: True if successful; JError if using legacy tree (no exception thrown in that case).
  • since: 11.1
  • throws: RuntimeException
  • access: public
mixed Send ()

Redefinition of:
PHPMailer::Send()
Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
sendAdminMail (line 529)

Sends mail to administrator for approval of a user submission

  • return: True on success
  • since: 11.1
  • access: public
boolean sendAdminMail (string $adminName, string $adminEmail, string $email, string $type, string $title, string $author, [string $url = null])
  • string $adminName: Name of administrator
  • string $adminEmail: Email address of administrator
  • string $email: [NOT USED TODO: Deprecate?]
  • string $type: Type of item to approve
  • string $title: Title of item to approve
  • string $author: Author of item to approve
  • string $url: A URL to included in the mail
sendMail (line 475)

Function to send an email

  • return: True on success
  • since: 11.1
  • access: public
boolean sendMail (string $from, string $fromName, mixed $recipient, string $subject, string $body, [boolean $mode = false], [mixed $cc = null], [mixed $bcc = null], [mixed $attachment = null], [mixed $replyTo = null], [mixed $replyToName = null])
  • string $from: From email address
  • string $fromName: From name
  • mixed $recipient: Recipient email address(es)
  • string $subject: email subject
  • string $body: Message body
  • boolean $mode: false = plain text, true = HTML
  • mixed $cc: CC email address(es)
  • mixed $bcc: BCC email address(es)
  • mixed $attachment: Attachment file name(s)
  • mixed $replyTo: Reply to email address(es)
  • mixed $replyToName: Reply to name(s)
setBody (line 185)

Set the email body

  • return: Returns this object for chaining.
  • since: 11.1
  • access: public
JMail setBody (string $content)
  • string $content: Body of the email
setSender (line 129)

Set the email sender

  • return: Returns this object for chaining.
  • since: 11.1
  • throws: UnexpectedValueException
  • access: public
JMail setSender (mixed $from)
  • mixed $from: email address and Name of sender
    1. array([0=> email Address[1=> Name)
    or as a string
setSubject (line 169)

Set the email subject

  • return: Returns this object for chaining.
  • since: 11.1
  • access: public
JMail setSubject (string $subject)
  • string $subject: Subject of the email
useSendmail (line 396)

Use sendmail for sending the email

  • return: True on success
  • since: 11.1
  • access: public
boolean useSendmail ([string $sendmail = null])
  • string $sendmail: Path to sendmail [optional]
useSMTP (line 428)

Use SMTP for sending the email

  • return: True on success
  • since: 11.1
  • access: public
boolean useSMTP ([string $auth = null], [string $host = null], [string $user = null], [string $pass = null], [string $secure = null], [integer $port = 25])
  • string $auth: SMTP Authentication [optional]
  • string $host: SMTP Host [optional]
  • string $user: SMTP Username [optional]
  • string $pass: SMTP Password [optional]
  • string $secure: Use secure methods
  • integer $port: The SMTP port

Inherited Methods

Inherited From PHPMailer

 PHPMailer::__construct()
 PHPMailer::AddAddress()
 PHPMailer::AddAnAddress()
 PHPMailer::AddAttachment()
 PHPMailer::AddBCC()
 PHPMailer::AddCC()
 PHPMailer::AddCustomHeader()
 PHPMailer::AddEmbeddedImage()
 PHPMailer::AddrAppend()
 PHPMailer::AddReplyTo()
 PHPMailer::AddrFormat()
 PHPMailer::AddStringAttachment()
 PHPMailer::AddStringEmbeddedImage()
 PHPMailer::AlternativeExists()
 PHPMailer::AttachAll()
 PHPMailer::AttachmentExists()
 PHPMailer::Base64EncodeWrapMB()
 PHPMailer::ClearAddresses()
 PHPMailer::ClearAllRecipients()
 PHPMailer::ClearAttachments()
 PHPMailer::ClearBCCs()
 PHPMailer::ClearCCs()
 PHPMailer::ClearCustomHeaders()
 PHPMailer::ClearReplyTos()
 PHPMailer::CreateBody()
 PHPMailer::CreateHeader()
 PHPMailer::DKIM_Add()
 PHPMailer::DKIM_BodyC()
 PHPMailer::DKIM_HeaderC()
 PHPMailer::DKIM_QP()
 PHPMailer::DKIM_Sign()
 PHPMailer::doCallback()
 PHPMailer::edebug()
 PHPMailer::EncodeFile()
 PHPMailer::EncodeHeader()
 PHPMailer::EncodeQ()
 PHPMailer::EncodeQP()
 PHPMailer::EncodeQPphp()
 PHPMailer::EncodeString()
 PHPMailer::EndBoundary()
 PHPMailer::filenameToType()
 PHPMailer::FixEOL()
 PHPMailer::GetAttachments()
 PHPMailer::GetBoundary()
 PHPMailer::GetMailMIME()
 PHPMailer::GetSentMIMEMessage()
 PHPMailer::GetTranslations()
 PHPMailer::HasMultiBytes()
 PHPMailer::HeaderLine()
 PHPMailer::html2text()
 PHPMailer::InlineImageExists()
 PHPMailer::IsError()
 PHPMailer::IsHTML()
 PHPMailer::IsMail()
 PHPMailer::IsQmail()
 PHPMailer::IsSendmail()
 PHPMailer::IsSMTP()
 PHPMailer::Lang()
 PHPMailer::MailSend()
 PHPMailer::mb_pathinfo()
 PHPMailer::MsgHTML()
 PHPMailer::NormalizeBreaks()
 PHPMailer::PostSend()
 PHPMailer::PreSend()
 PHPMailer::RFCDate()
 PHPMailer::SecureHeader()
 PHPMailer::Send()
 PHPMailer::SendmailSend()
 PHPMailer::ServerHostname()
 PHPMailer::set()
 PHPMailer::SetError()
 PHPMailer::SetFrom()
 PHPMailer::SetLanguage()
 PHPMailer::SetMessageType()
 PHPMailer::SetWordWrap()
 PHPMailer::Sign()
 PHPMailer::SmtpClose()
 PHPMailer::SmtpConnect()
 PHPMailer::SmtpSend()
 PHPMailer::TextLine()
 PHPMailer::UTF8CharBoundary()
 PHPMailer::ValidateAddress()
 PHPMailer::WrapText()
 PHPMailer::_mime_types()
 PHPMailer::__destruct()
Class Constants

Documentation generated on Tue, 19 Nov 2013 15:07:30 +0100 by phpDocumentor 1.4.3