Actions

API15

Difference between revisions of "JMail/JMail"

From Joomla! Documentation

< API15:JMail
(New page: ===Description=== Constructor <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Descript...)
 
m (removing red link to edit, no existant pages)
 
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JMail/JMail|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JMail/JMail}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 27: Line 27:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JMail/JMail|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JMail/JMail}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 42: Line 42:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Latest revision as of 13:35, 12 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Constructor

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

JMail()


Defined in

libraries/joomla/mail/mail.php

Importing

jimport( 'joomla.mail.mail' );

Source Body

function JMail()
{
         // phpmailer has an issue using the relative path for it's language files
         $this->SetLanguage('joomla', JPATH_LIBRARIES.DS.'phpmailer'.DS.'language'.DS);
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />

May not always work

addCC may not always work on 1.5 due to an error in the phpmailer class. to forum topic.


E-builds 05:36, 1 March 2011 (CST) Edit comment
If you want to validate an e-mail address in your code and you will use JMAIL anyway, you can use the function from its parent class phpmailer.
$mail   =& JFactory::getMailer();
if (!$mail->ValidateAddress($mailaddress)) echo 'Invalid';

This is implicitly done for every JMAIL function that sets an address (such as addRecipient, addBCC, ..) and though there are other potential errors besides address validating, it most probably is something you want catch too.

$mail   =& JFactory::getMailer();
if ($mail->addRecipient($mailaddress)->IsError()) echo 'Invalid';