// 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:
rMalie
2011-10-03 09:14:01 +00:00
parent f1e265fad4
commit ef17d0b7da
44 changed files with 622 additions and 366 deletions
+9 -6
View File
@@ -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;
}