Joomla! 1.5 API

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2011 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class JMail

Description

E-Mail Class. Provides a common interface to send e-mail from the Joomla! Framework

  • since: 1.5

Located in /joomla/mail/mail.php (line 28)

Class PHPMailer

Class JMail   (Subpackage Mail)
Method Summary
Static method static object The &getInstance ([string $id = 'Joomla'])
Constructor JMail JMail ()
Method void addAttachment (mixed $attachment)
Method void addBCC ( $bcc, mixed $cc)
Method void addCC (mixed $cc)
Method void addRecipient (mixed $recipient)
Method void addReplyTo ( $replyto, array $reply)
Method mixed &Send ()
Method void setBody (string $content)
Method void setSender (array $from)
Method void setSubject (string $subject)
Method boolean useSendmail ([string $sendmail = null])
Method boolean useSMTP ([string $auth = null], [string $host = null], [string $user = null], [string $pass = null], [string $secure = null], [string $port = 25])
Methods
Constructor JMail (line 35)

Constructor

JMail JMail ()
addAttachment (line 229)

Add file attachments to the email

  • since: 1.5
  • access: public
void addAttachment (mixed $attachment)
  • mixed $attachment: Either a string or array of strings [filenames]
addBCC (line 204)

Add blind carbon copy recipients to the email

  • since: 1.5
  • access: public
void addBCC ( $bcc, mixed $cc)
  • mixed $cc: Either a string or array of strings [e-mail address(es)]
  • $bcc
addCC (line 179)

Add carbon copy recipients to the email

  • since: 1.5
  • access: public
void addCC (mixed $cc)
  • mixed $cc: Either a string or array of strings [e-mail address(es)]
addRecipient (line 156)

Add recipients to the email

  • since: 1.5
  • access: public
void addRecipient (mixed $recipient)
  • mixed $recipient: Either a string or array of strings [e-mail address(es)]
addReplyTo (line 255)

Add Reply to e-mail address(es) to the e-mail

  • since: 1.5
  • access: public
void addReplyTo ( $replyto, array $reply)
  • array $reply: Either an array or multi-array of form
                 array( [0] => E-Mail Address [1] => Name )
  • $replyto
getInstance (line 57)

Returns a reference to a global e-mail object, only creating it if it doesn't already exist.

This method must be invoked as:

  $mail =& JMail::getInstance();

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: global JMail object
  • since: 1.5
  • access: public
object The &getInstance ([string $id = 'Joomla'])
  • string $id: The id string for the JMail instance [optional]
Send (line 75)
  • return: True if successful, a JError object otherwise
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.
setBody (line 139)

Set the E-Mail body

  • since: 1.5
  • access: public
void setBody (string $content)
  • string $content: Body of the e-mail
setSender (line 103)

Set the E-Mail sender

  • since: 1.5
  • access: public
void setSender (array $from)
  • array $from: E-Mail address and Name of sender
                 array( [0] => E-Mail Address [1] => Name )
setSubject (line 127)

Set the E-Mail subject

  • since: 1.5
  • access: public
void setSubject (string $subject)
  • string $subject: Subject of the e-mail
useSendmail (line 280)

Use sendmail for sending the e-mail

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

Use SMTP for sending the e-mail

  • return: True on success
  • since: 1.5
  • access: public
boolean useSMTP ([string $auth = null], [string $host = null], [string $user = null], [string $pass = null], [string $secure = null], [string $port = 25])
  • string $auth: SMTP Authentication [optional]
  • string $host: SMTP Host [optional]
  • string $user: SMTP Username [optional]
  • string $pass: SMTP Password [optional]
  • string $secure: SMTP Secure ssl,tls [optinal]
  • string $port: SMTP Port [optional]

Inherited Methods

Inherited From PHPMailer

 PHPMailer::AddAddress()
 PHPMailer::AddAttachment()
 PHPMailer::AddBCC()
 PHPMailer::AddCC()
 PHPMailer::AddCustomHeader()
 PHPMailer::AddEmbeddedImage()
 PHPMailer::AddReplyTo()
 PHPMailer::AddStringAttachment()
 PHPMailer::ClearAddresses()
 PHPMailer::ClearAllRecipients()
 PHPMailer::ClearAttachments()
 PHPMailer::ClearBCCs()
 PHPMailer::ClearCCs()
 PHPMailer::ClearCustomHeaders()
 PHPMailer::ClearReplyTos()
 PHPMailer::getFile()
 PHPMailer::HeaderLine()
 PHPMailer::IsError()
 PHPMailer::IsHTML()
 PHPMailer::IsMail()
 PHPMailer::IsQmail()
 PHPMailer::IsSendmail()
 PHPMailer::IsSMTP()
 PHPMailer::MsgHTML()
 PHPMailer::Send()
 PHPMailer::set()
 PHPMailer::SetLanguage()
 PHPMailer::Sign()
 PHPMailer::SmtpClose()
Support Joomla!