cancel
Showing results for 
Search instead for 
Did you mean: 

External SMTP setup in Magento 1.xx

External SMTP setup in Magento 1.xx

Hi, I need some expert help. I did some searching on this forum but wasn't able to find the answer. Hers is what I have so far, I was able to track down the code that is floating around to enable external SMTP (see below) but when added, I received a syntax error (also see below). Apparently Magento does not recognize the @ sign in the email address or is there something else I am overlooking? Thank you any help or suggestions.

 

Code:

 

$my_smtp_host = Mage::getStoreConfig(‘system/smtp/host’);
$my_smtp_port = Mage::getStoreConfig(‘system/smtp/port’);
$config = array(
‘port’ => $my_smtp_port,
‘auth’ => ‘login’,
‘username’ => ’xxxxxxxx@gmail.com’,
‘password’ => ‘somepassword’                                               );
$transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);
Zend_Mail::setDefaultTransport($transport);
 
Error message:
 
Parse error: syntax error, unexpected '@', expecting ')' in /home/waterbab/public_html/app/code/core/Mage/Core/Model/Email/Template.php on line 112
2 REPLIES 2

Re: External SMTP setup in Magento 1.xx

@michael_chuYou have the problem with the single quotes. Single quote you have used in the code are apostrophe. Once you'll change them to single quote your code should work.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: External SMTP setup in Magento 1.xx

WOW, I had to zoom in 10X to see that lol. The code was copied and pasted from a tutorial, I thought it would have been in the correct syntax, that teaches me to look twice. Thank you very much for the info.

I made the changes to the code, the syntax error is gone however the email still won't send using the external SMTP, any ideas why that would be? The SMTP server is correct, user name (email address) and passwords all have been verified. Cant figure out what else is missing.