Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problems with Mail over Smtp
 
Andreas Bruckmeier
Jr. Member
 
Total Posts:  8
Joined:  2008-05-14
 

I need to send mails over a smtp-server with TLS so i extended Mage_Core_Model_Email_Template with the following code:

public function send($email$name=null, array $variables = array()) {

    
if(!$this->isValidForSend()) {
        
return false;
    
}
        
+   $config = array(
+        
'ssl' => 'tls',
+        
'port' => '25',
+        
'auth' => 'login'
+        
'username' => 'xxx',
+        
'password' => 'xxx'
+   );
        
+   
$transport = new Zend_Mail_Transport_Smtp('xxx'$config);

....................................................

    try 
{
-       $mail->send();
+       
$mail->send($transport);
         
$this->_mail null;
    
catch (Exception $e{
        
return false;
    
}

        
return true;
    
}
}

But now the application freezes while executing the method

$mail->send($transport);

The same code in it’s own source file works

<?php
set_include_path
('lib' PATH_SEPARATOR get_include_path());

require_once 
'lib/Zend/Mail.php';
require_once 
'lib/Zend/Mail/Transport/Smtp.php';

$config = array(
    
'ssl' => 'tls',
    
'port' => '25',
    
'auth' => 'login'
    
'username' => 'xxx',
    
'password' => 'xxx'
);

$transport = new Zend_Mail_Transport_Smtp('xxx'$config);

$mail = new Zend_Mail('utf-8');
$mail->addTo('xxx''To-Name');
$mail->setFrom('xxx''From-Name');
$mail->setSubject('Test-Subject');
$mail->setBodyText('...Test Message...');
$mail->send($transport);
?>

But Magento freezes, no error, no log, just the Ajax-Icon turning around forever (for example when placing an order)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unic
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2008-01-08
Zürich, Switzerland
 

We are having the same Issue. Is there any solution available?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikkstocks
Member
 
Total Posts:  47
Joined:  2008-06-08
 

SSL/TLS connections are through port 465 my default, not 25 so it might be as simple as that…

i cant help with the magento code itself im afrad (as im a complete novice) but if you happen to be running your own linux server i’d recommend you install ‘ssmtp’ (apt-get install ssmtp), really easy to setup with php.ini, and it does exactly what your wanting

 
Magento Community Magento Community
Magento Community
Magento Community
 
PHOENIX
Guru
 
Avatar
Total Posts:  549
Joined:  2007-12-19
Stuttgart, Germany
 

The problem is located in Zend_Mime.php. See http://www.magentocommerce.com/boards/viewreply/36118/ for details.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top