Files
faveo/app/Http/Controllers/Common/CommonMailer.php
Manish Verma 2f6ce43fe1 Bugfix and language updates
Fixed links and language translations in installert.
Fixed outgoing mail issue.
2018-08-13 18:39:36 +05:30

41 lines
1.1 KiB
PHP

<?php
namespace App\Http\Controllers\Common;
use Exception;
class CommonMailer
{
public function setSmtpDriver($config)
{
try {
if (!$config) {
return false;
}
$https = [];
$https['ssl']['verify_peer'] = FALSE;
$https['ssl']['verify_peer_name'] = FALSE;
$transport = new \Swift_SmtpTransport($config['host'], $config['port'], $config['security']);
$transport->setUsername($config['username']);
$transport->setPassword($config['password']);
$transport->setStreamOptions($https);
$set = new \Swift_Mailer($transport);
// Set the mailer
\Mail::setSwiftMailer($set);
return true;
} catch (Exception $e) {
loging($e->getMessage());
return $e->getMessage();
}
}
public function setMailGunDriver($config)
{
if (!$config) {
return false;
}
return true;
}
}