API16:JMailHelper/cleanBody
From Joomla! Documentation
Description
Cleans any injected headers from the E-Mail body.
Syntax
static cleanBody($body)
| Parameter Name | Default Value | Description |
|---|---|---|
| $body | $body E-Mail body string. |
Returns
string Cleaned E-Mail body string.
Defined in
libraries/joomla/mail/helper.php
Importing
jimport( 'joomla.mail.helper' );
Source Body
public static function cleanBody($body)
{
// Strip all E-Mail headers from a string
return preg_replace("/((From:|To:|Cc:|Bcc:|Subject:|Content-type:) ([\S]+))/", "", $body);
}
Examples
Code Examples