CMSimple_XH
Public Member Functions | List of all members
XH\Mail Class Reference

Emails. More...

Public Member Functions

 __construct ()
 Initializes a new instance.
 
 isValidAddress ($address)
 Returns whether an email address is valid. More...
 
 setTo ($to)
 Sets the To address. More...
 
 getSubject ()
 Returns the encoded subject. More...
 
 setSubject ($subject)
 Sets the Subject. More...
 
 setMessage ($message)
 Sets the message. More...
 
 addHeader ($name, $value)
 Adds a header field. More...
 
 send ()
 Sends the email and return whether that succeeded. More...
 

Detailed Description

Emails.

Author
Peter Harteg peter.nosp@m.@har.nosp@m.teg.d.nosp@m.k
The CMSimple_XH developers devs@.nosp@m.cmsi.nosp@m.mple-.nosp@m.xh.o.nosp@m.rg
Since
1.7

Member Function Documentation

◆ addHeader()

XH\Mail::addHeader (   $name,
  $value 
)

Adds a header field.

Parameters
string$nameA header field name.
string$valueA header field value.
Returns
void

◆ getSubject()

XH\Mail::getSubject ( )

Returns the encoded subject.

Returns
string

◆ isValidAddress()

XH\Mail::isValidAddress (   $address)

Returns whether an email address is valid.

For simplicity we are not aiming for full compliance with RFC 5322. The local-part must be a dot-atom-text. The domain is checked with gethostbyname() after applying idn_to_ascii(), if the latter is available.

Parameters
string$addressAn email address.
Returns
bool

◆ send()

XH\Mail::send ( )

Sends the email and return whether that succeeded.

Returns
bool

◆ setMessage()

XH\Mail::setMessage (   $message)

Sets the message.

Parameters
string$messageA message.
Returns
void

◆ setSubject()

XH\Mail::setSubject (   $subject)

Sets the Subject.

Parameters
string$subjectA subject.
Returns
void

◆ setTo()

XH\Mail::setTo (   $to)

Sets the To address.

Parameters
string$toA valid email address.
Returns
void

The documentation for this class was generated from the following file: