PHP Class Mail, huge

User: Hp Date: 06/06/2015 Time: 14:33
Mostra file Open project: panique/huge Class Usage Examples

Public Methods

Method Description
getError ( ) : mixed The different mail sending methods write errors to the error property $this->error, this method simply returns this error / error array.
sendMail ( $user_email, $from_email, $from_name, $subject, $body ) : boolean The main mail sending method, this simply calls a certain mail sending method depending on which mail provider you've selected in the application's config.
sendMailWithNativeMailFunction ( ) Try to send a mail by using PHP's native mail() function.
sendMailWithPHPMailer ( $user_email, $from_email, $from_name, $subject, $body ) : boolean Try to send a mail by using PHPMailer.
sendMailWithSwiftMailer ( ) : boolean Try to send a mail by using SwiftMailer.

Method Details

getError() public method

The different mail sending methods write errors to the error property $this->error, this method simply returns this error / error array.
public getError ( ) : mixed
return mixed

sendMail() public method

The main mail sending method, this simply calls a certain mail sending method depending on which mail provider you've selected in the application's config.
public sendMail ( $user_email, $from_email, $from_name, $subject, $body ) : boolean
$user_email string email
$from_email string sender's email
$from_name string sender's name
$subject string subject
$body string full mail body text
return boolean the success status of the according mail sending method

sendMailWithNativeMailFunction() public method

Please note that not PHP itself will send a mail, it's just a wrapper for Linux's sendmail or other mail tools Good guideline on how to send mails natively with mail():
See also: http://stackoverflow.com/a/24644450/1114320
See also: http://www.php.net/manual/en/function.mail.php

sendMailWithPHPMailer() public method

Make sure you have loaded PHPMailer via Composer. Depending on your EMAIL_USE_SMTP setting this will work via SMTP credentials or via native mail()
public sendMailWithPHPMailer ( $user_email, $from_email, $from_name, $subject, $body ) : boolean
$user_email
$from_email
$from_name
$subject
$body
return boolean

sendMailWithSwiftMailer() public method

Make sure you have loaded SwiftMailer via Composer.