|
|
@@ -13,17 +13,22 @@ class Email {
|
|
|
public static function getPHPMailerInstance() {
|
|
|
$mail = new PHPMailer(true);
|
|
|
|
|
|
- if(defined("SMTP_HOST")) {
|
|
|
- $mail->isSMTP();
|
|
|
- $mail->Host = SMTP_HOST;
|
|
|
- $mail->SMTPAuth = true;
|
|
|
- $mail->Username = SMTP_USERNAME;
|
|
|
- $mail->Password = SMTP_PASSWORD;
|
|
|
- $mail->SMTPSecure = SMTP_AUTHENTICATION_TYPE;
|
|
|
- $mail->Port = SMTP_PORT;
|
|
|
- }
|
|
|
- else {
|
|
|
- $mail->isMail();
|
|
|
+ switch(MAILER) {
|
|
|
+ case "smtp":
|
|
|
+ $mail->isSMTP();
|
|
|
+ $mail->Host = SMTP_HOST;
|
|
|
+ $mail->SMTPAuth = true;
|
|
|
+ $mail->Username = SMTP_USERNAME;
|
|
|
+ $mail->Password = SMTP_PASSWORD;
|
|
|
+ $mail->SMTPSecure = SMTP_AUTHENTICATION_TYPE;
|
|
|
+ $mail->Port = SMTP_PORT;
|
|
|
+ break;
|
|
|
+ case "mail":
|
|
|
+ $mail->isMail();
|
|
|
+ break;
|
|
|
+ case "sendmail":
|
|
|
+ $mail->isSendmail();
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
$mail->CharSet = 'UTF-8';
|