|
|
@@ -12,13 +12,20 @@ class Email {
|
|
|
// Static functions
|
|
|
public static function getPHPMailerInstance() {
|
|
|
$mail = new PHPMailer(true);
|
|
|
- $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;
|
|
|
+
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+
|
|
|
$mail->CharSet = 'UTF-8';
|
|
|
$mail->Encoding = 'base64';
|
|
|
return $mail;
|