// Merge -> revision 8952
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8957 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+9
-6
@@ -190,12 +190,11 @@ class MailCore
|
||||
public static function sendMailTest($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort = 25, $smtpEncryption)
|
||||
{
|
||||
$swift = NULL;
|
||||
$result = NULL;
|
||||
$result = false;
|
||||
try
|
||||
{
|
||||
if($smtpChecked)
|
||||
{
|
||||
|
||||
$smtp = new Swift_Connection_SMTP($smtpServer, $smtpPort, ($smtpEncryption == "off") ? Swift_Connection_SMTP::ENC_OFF : (($smtpEncryption == "tls") ? Swift_Connection_SMTP::ENC_TLS : Swift_Connection_SMTP::ENC_SSL));
|
||||
$smtp->setUsername($smtpLogin);
|
||||
$smtp->setpassword($smtpPassword);
|
||||
@@ -209,13 +208,17 @@ class MailCore
|
||||
|
||||
if ($swift->send($message, $to, $from))
|
||||
$result = true;
|
||||
else
|
||||
$result = 999;
|
||||
|
||||
$swift->disconnect();
|
||||
}
|
||||
catch (Swift_Connection_Exception $e) { $result = $e->getCode(); }
|
||||
catch (Swift_Message_MimeException $e) { $result = $e->getCode(); }
|
||||
catch (Swift_ConnectionException $e)
|
||||
{
|
||||
$result = $e->getMessage();
|
||||
}
|
||||
catch (Swift_Message_MimeException $e)
|
||||
{
|
||||
$result = $e->getMessage();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user