MailHelper

Email helper class, provides static methods to perform various tasks relevant to the Joomla email routines.

abstract
todo:

Test these methods as the regex work is first run and not tested thoroughly

since

1.7.0

package

Joomla CMS

Methods

checkContent

Check the content after regular expression function call.

checkContent( content) : 
static
throws

RuntimeExceptionIf there is an error in previous regular expression function call.

since

4.1.0

Arguments

content

stringContent to be checked.

Response

void

cleanAddress

Verifies that an email address does not have any extra headers injected into it.

cleanAddress( address) : 
static
since

1.7.0

Arguments

address

stringemail address.

Response

mixedemail address string or boolean false if injected headers are present.

cleanBody

Cleans any injected headers from the email body.

cleanBody( body) : 
static
since

1.7.0

Arguments

body

stringemail body string.

Response

stringCleaned email body string.

cleanLine

Cleans single line inputs.

cleanLine( value) : 
static
since

1.7.0

Arguments

value

stringString to be cleaned.

Response

stringCleaned string.

cleanSubject

Cleans any injected headers from the subject string.

cleanSubject( subject) : 
static
since

1.7.0

Arguments

subject

stringemail subject string.

Response

stringCleaned email subject string.

cleanText

Cleans multi-line inputs.

cleanText( value) : 
static
since

1.7.0

Arguments

value

stringMulti-line string to be cleaned.

Response

stringCleaned multi-line string.

convertRelativeToAbsoluteUrls

Convert relative (links, images sources) to absolute urls so that content is accessible in email

convertRelativeToAbsoluteUrls( content) : 
static
since

4.1.0

Arguments

content

stringThe content need to convert

Response

stringThe converted content which the relative urls are converted to absolute urls

isEmailAddress

Verifies that the string is in a proper email address format.

isEmailAddress( email) : 
static
since

1.7.0

Arguments

email

stringString to be verified.

Response

boolTrue if string has the correct format; false otherwise.