Class JMail
	
	
Email Class. Provides a common interface to send email from the Joomla!
Platform
	 
	
		- 
			PHPMailer
			
			
			
		
- 
			 JMail JMail
Methods summary
		
		
			| 
				 public 
				
				
				 | 
			#
			__construct( boolean $exceptions = true )
				
Constructor Parameters
						$exceptionsboolean- $exceptions Flag if Exceptions should be thrownSince
							11.1
 Overrides | 
		
			| 
				 public static
				JMail | 
			#
			getInstance( string $id = 'Joomla', boolean $exceptions = true )
				
Returns the global email object, only creating it if it doesn't already
exist. 
				
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'. Parameters
						$idstring- $id The id string for the JMail instance [optional]$exceptionsboolean- $exceptions Flag if Exceptions should be thrown [optional]Returns
						JMail - The global JMail object
					 Since
							11.1
 | 
		
			| 
				 public 
				boolean|JException | 
			#
			Send( )
				
Send the mail Returns
						boolean|JException - 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.
					 ThrowsSince
							11.1
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			setFrom( string $address, string $name = '', boolean $auto = true )
				
Set the From and FromName properties. 
				
Set the From and FromName properties. Parameters
						$addressstring- $address The sender email address$namestring- $name The sender name$autoboolean- $auto Whether to also set the Sender address, defaults to trueReturns
						boolean
 ThrowsSince
							11.1
 Overrides | 
		
			| 
				 public 
				JMail|boolean | 
			#
			setSender( mixed $from )
				
Set the email sender Parameters
						$frommixed- $from email address and Name of sender<span
class="php-keyword1">array</span>([<span
class="php-num">0</span>] => email Address, [<span
class="php-num">1</span>] => Name)or as a stringReturns
						JMail|boolean - Returns this object for chaining on success or boolean false on failure.
					 ThrowsSince
							11.1
 | 
		
			| 
				 public 
				JMail | 
			#
			setSubject( string $subject )
				
Set the email subject Parameters
						$subjectstring- $subject Subject of the emailReturns
						JMail - Returns this object for chaining.
					 Since
							11.1
 | 
		
			| 
				 public 
				JMail | 
			#
			setBody( string $content )
				
Set the email body Parameters
						$contentstring- $content Body of the emailReturns
						JMail - Returns this object for chaining.
					 Since
							11.1
 | 
		
			| 
				 protected 
				JMail|boolean | 
			#
			add( mixed $recipient, mixed $name = '', string $method = 'addAddress' )
				
Add recipients to the email. 
				
Add recipients to the email. Parameters
						$recipientmixed- $recipient Either a string or array of strings [email address(es)]$namemixed- $name Either a string or array of strings [name(s)]$methodstring- $method The parent method's name.Returns
						JMail|boolean - Returns this object for chaining on success or boolean false on failure.
					 ThrowsSince
							11.1
 | 
		
			| 
				 public 
				JMail|boolean | 
			#
			addRecipient( mixed $recipient, mixed $name = '' )
				
Add recipients to the email 
				
Add recipients to the email Parameters
						$recipientmixed- $recipient Either a string or array of strings [email address(es)]$namemixed- $name Either a string or array of strings [name(s)]Returns
						JMail|boolean - Returns this object for chaining.
					 Since
							11.1
 | 
		
			| 
				 public 
				JMail|boolean | 
			#
			addCc( mixed $cc, mixed $name = '' )
				
Add carbon copy recipients to the email 
				
Add carbon copy recipients to the email Parameters
						$ccmixed- $cc Either a string or array of strings [email address(es)]$namemixed- $name Either a string or array of strings [name(s)]Returns
						JMail|boolean - Returns this object for chaining on success or boolean false on failure.
					 Since
							11.1
 | 
		
			| 
				 public 
				JMail|boolean | 
			#
			addBcc( mixed $bcc, mixed $name = '' )
				
Add blind carbon copy recipients to the email 
				
Add blind carbon copy recipients to the email Parameters
						$bccmixed- $bcc Either a string or array of strings [email address(es)]$namemixed- $name Either a string or array of strings [name(s)]Returns
						JMail|boolean - Returns this object for chaining on success or boolean false on failure.
					 Since
							11.1
 | 
		
			| 
				 public 
				JMail|boolean | 
			#
			addAttachment( mixed $path, mixed $name = '', mixed $encoding = 'base64', mixed $type = 'application/octet-stream', string $disposition = 'attachment' )
				
Add file attachment to the email 
				
Add file attachment to the email Parameters
						$pathmixed- $path Either a string or array of strings [filenames]$namemixed- $name Either a string or array of strings [names]$encodingmixed- $encoding The encoding of the attachment$typemixed- $type The mime type$dispositionstring- $disposition The disposition of the attachmentReturns
						JMail|boolean - Returns this object for chaining on success or boolean false on failure.
					 ThrowsSince
							12.2
 Overrides | 
		
			| 
				 public 
				JMail | 
			#
			clearAttachments( )
				
Unset all file attachments from the email 
				
Unset all file attachments from the email Returns
						JMail - Returns this object for chaining.
					 Since
							12.2
 Overrides | 
		
			| 
				 public 
				JMail | 
			#
			removeAttachment( integer $index = 0 )
				
Unset file attachments specified by array index. 
				
Unset file attachments specified by array index. Parameters
						$indexinteger- $index The numerical index of the attachment to removeReturns
						JMail - Returns this object for chaining.
					 Since
							12.2
 | 
		
			| 
				 public 
				JMail|boolean | 
			#
			addReplyTo( mixed $replyto, mixed $name = '' )
				
Add Reply to email address(es) to the email 
				
Add Reply to email address(es) to the email Parameters
						$replytomixed- $replyto Either a string or array of strings [email address(es)]$namemixed- $name Either a string or array of strings [name(s)]Returns
						JMail|boolean - Returns this object for chaining on success or boolean false on failure.
					 Since
							11.1
 Overrides | 
		
			| 
				 public 
				JMail | 
			#
			isHtml( boolean $ishtml = true )
				
Sets message type to HTML 
				
Sets message type to HTML Parameters
						$ishtmlboolean- $ishtml Boolean true or false.Returns
						JMail - Returns this object for chaining.
					 Since
							12.3
 | 
		
			| 
				 public 
				
				
				 | 
			#
			isSendmail( )
				
Send messages using $Sendmail. 
				
Send messages using $Sendmail. This overrides the parent class to remove the restriction on the executable's
name containing the word "sendmail" Since
							11.1
 Overrides | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			useSendmail( string $sendmail = null )
				
Use sendmail for sending the email 
				
Use sendmail for sending the email Parameters
						$sendmailstring- $sendmail Path to sendmail [optional]Returns
						boolean- True on success
 Since
							11.1
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			useSmtp( string $auth = null, string $host = null, string $user = null, string $pass = null, string $secure = null, integer $port = 25 )
				
Use SMTP for sending the email 
				
Use SMTP for sending the email Parameters
						$authstring- $auth SMTP Authentication [optional]$hoststring- $host SMTP Host [optional]$userstring- $user SMTP Username [optional]$passstring- $pass SMTP Password [optional]$securestring- $secure Use secure methods$portinteger- $port The SMTP portReturns
						boolean- True on success
 Since
							11.1
 | 
		
			| 
				 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 )
				
Function to send an email 
				
Function to send an email Parameters
						$fromstring- $from From email address$fromNamestring- $fromName From name$recipientmixed- $recipient Recipient email address(es)$subjectstring- $subject email subject$bodystring- $body Message body$modeboolean- $mode false = plain text, true = HTML$ccmixed- $cc CC email address(es)$bccmixed- $bcc BCC email address(es)$attachmentmixed- $attachment Attachment file name(s)$replyTomixed- $replyTo Reply to email address(es)$replyToNamemixed- $replyToName Reply to name(s)Returns
						boolean- True on success
 Since
							11.1
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			sendAdminMail( string $adminName, string $adminEmail, string $email, string $type, string $title, string $author, string $url = null )
				
Sends mail to administrator for approval of a user submission 
				
Sends mail to administrator for approval of a user submission Deprecated
							4.0 Without replacement please implement it in your own code
 Parameters
						$adminNamestring- $adminName Name of administrator$adminEmailstring- $adminEmail Email address of administrator$emailstring- $email [NOT USED TODO: Deprecate?]$typestring- $type Type of item to approve$titlestring- $title Title of item to approve$authorstring- $author Author of item to approve$urlstring- $url A URL to included in the mailReturns
						boolean- True on success
 Since
							11.1
 | 
		
		Methods inherited from PHPMailer
		
			DKIM_Add(), 
			DKIM_BodyC(), 
			DKIM_HeaderC(), 
			DKIM_QP(), 
			DKIM_Sign(), 
			__destruct(), 
			_mime_types(), 
			addAddress(), 
			addAnAddress(), 
			addBCC(), 
			addCC(), 
			addCustomHeader(), 
			addEmbeddedImage(), 
			addOrEnqueueAnAddress(), 
			addStringAttachment(), 
			addStringEmbeddedImage(), 
			addrAppend(), 
			addrFormat(), 
			alternativeExists(), 
			attachAll(), 
			attachmentExists(), 
			base64EncodeWrapMB(), 
			clearAddresses(), 
			clearAllRecipients(), 
			clearBCCs(), 
			clearCCs(), 
			clearCustomHeaders(), 
			clearQueuedAddresses(), 
			clearReplyTos(), 
			createBody(), 
			createHeader(), 
			doCallback(), 
			edebug(), 
			encodeFile(), 
			encodeHeader(), 
			encodeQ(), 
			encodeQP(), 
			encodeQPphp(), 
			encodeString(), 
			endBoundary(), 
			filenameToType(), 
			fixEOL(), 
			generateId(), 
			getAllRecipientAddresses(), 
			getAttachments(), 
			getBccAddresses(), 
			getBoundary(), 
			getCcAddresses(), 
			getCustomHeaders(), 
			getLastMessageID(), 
			getMailMIME(), 
			getReplyToAddresses(), 
			getSMTPInstance(), 
			getSentMIMEMessage(), 
			getToAddresses(), 
			getTranslations(), 
			has8bitChars(), 
			hasLineLongerThanMax(), 
			hasMultiBytes(), 
			headerLine(), 
			html2text(), 
			idnSupported(), 
			inlineImageExists(), 
			isError(), 
			isHTML(), 
			isMail(), 
			isQmail(), 
			isSMTP(), 
			isShellSafe(), 
			lang(), 
			mailSend(), 
			mb_pathinfo(), 
			msgHTML(), 
			normalizeBreaks(), 
			parseAddresses(), 
			postSend(), 
			preSend(), 
			punyencodeAddress(), 
			rfcDate(), 
			secureHeader(), 
			send(), 
			sendmailSend(), 
			serverHostname(), 
			set(), 
			setError(), 
			setLanguage(), 
			setMessageType(), 
			setWordWrap(), 
			sign(), 
			smtpClose(), 
			smtpConnect(), 
			smtpSend(), 
			textLine(), 
			utf8CharBoundary(), 
			validateAddress(), 
			wrapText()
		
		Magic methods summary
		Constants summary
		Constants inherited from PHPMailer
		
			CRLF, 
			MAX_LINE_LENGTH, 
			STOP_CONTINUE, 
			STOP_CRITICAL, 
			STOP_MESSAGE
		
		Properties summary
		
		
			| 
				protected static 
				JMail[] | $instances | 
				#
				
					
JMail instances container. 
					
JMail instances container. Since
								11.3
 | 
		
			| 
				public  
				string
			 | $CharSet | 
				#
				
				
					
Charset of the message. Since
								11.1
 | 
		
		Properties inherited from PHPMailer
		
			$AllowEmpty, 
			$AltBody, 
			$AuthType, 
			$Body, 
			$ConfirmReadingTo, 
			$ContentType, 
			$CustomHeader, 
			$DKIM_domain, 
			$DKIM_identity, 
			$DKIM_passphrase, 
			$DKIM_private, 
			$DKIM_private_string, 
			$DKIM_selector, 
			$Debugoutput, 
			$Encoding, 
			$ErrorInfo, 
			$From, 
			$FromName, 
			$Helo, 
			$Host, 
			$Hostname, 
			$Ical, 
			$LE, 
			$MIMEBody, 
			$MIMEHeader, 
			$Mailer, 
			$MessageDate, 
			$MessageID, 
			$Password, 
			$PluginDir, 
			$Port, 
			$Priority, 
			$Realm, 
			$RecipientsQueue, 
			$ReplyTo, 
			$ReplyToQueue, 
			$ReturnPath, 
			$SMTPAuth, 
			$SMTPAutoTLS, 
			$SMTPDebug, 
			$SMTPKeepAlive, 
			$SMTPOptions, 
			$SMTPSecure, 
			$Sender, 
			$Sendmail, 
			$SingleTo, 
			$SingleToArray, 
			$Subject, 
			$Timeout, 
			$UseSendmailOptions, 
			$Username, 
			$Version, 
			$WordWrap, 
			$Workstation, 
			$XMailer, 
			$action_function, 
			$all_recipients, 
			$attachment, 
			$bcc, 
			$boundary, 
			$cc, 
			$do_verp, 
			$error_count, 
			$exceptions, 
			$language, 
			$lastMessageID, 
			$mailHeader, 
			$message_type, 
			$sign_cert_file, 
			$sign_extracerts_file, 
			$sign_key_file, 
			$sign_key_pass, 
			$smtp, 
			$to, 
			$uniqueid, 
			$validator