Email class serve function sendEmail() to send email.
More...
|
static | sendEmail ($email_from, $email_to, $email_cc, $email_subject, $email_message) |
| send an email More...
|
|
Email class serve function sendEmail() to send email.
send an email.
handles the email functions. main method is
Example: <?php YAWK\email::sendEmail($email_from, $email_to, $email_cc, $email_subject, $email_message); ?>
Call this anytime when you need to send an email.
Class covers both, backend & frontend functionality. See Methods Summary for Details!
- Author
- Daniel Retzl danie.nosp@m.lret.nosp@m.zl@gm.nosp@m.ail..nosp@m.com
- Copyright
- 2009-2015 Daniel Retzl yawk.io @license https://opensource.org/licenses/MIT
- Version
- 1.0.0
Definition at line 19 of file email.php.
◆ sendEmail()
static YAWK\email::sendEmail |
( |
|
$email_from, |
|
|
|
$email_to, |
|
|
|
$email_cc, |
|
|
|
$email_subject, |
|
|
|
$email_message |
|
) |
| |
|
static |
send an email
- Parameters
-
string | $email_from | |
string | $email_to | |
string | $email_cc | |
string | $email_subject | |
string | $email_message | |
- Returns
- bool
Definition at line 31 of file email.php.
36 $email_from = trim($email_from);
37 $email_to = trim($email_to);
38 $email_cc = trim($email_cc);
39 $email_subject = trim($email_subject);
40 $email_message = trim($email_message);
42 if (!isset($email_cc) || (empty($email_cc)))
48 $email_exp =
'/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
49 if (!preg_match($email_exp, $email_from)) {
55 $headers =
'From: ' . $email_from .
"\r\n" .
56 'Reply-To: ' . $email_from .
"\r\n" .
57 'X-Mailer: PHP/' . phpversion();
59 if ($email_cc === TRUE)
62 $sent = @mail($email_to, $email_subject, $email_message, $headers);
64 $sent = @mail($email_from, $email_subject, $email_message, $headers);
69 $sent = @mail($email_to, $email_subject, $email_message, $headers);
Referenced by YAWK\user\sendResetEmail().
The documentation for this class was generated from the following file:
- /var/www/htdocs/yawk.io/system/classes/email.php