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

Poll
Should Magento support any Transport Agent
Yes sure 392
Yes Maybe 23
Yes 50
I don’t know 31
Total Votes: 496
You must be a logged-in member to vote
Use any smtp to send email (even gmail)
 
hallowed
Jr. Member
 
Total Posts:  21
Joined:  2008-08-19
 

I am running Linux and I run into the same issues as far as emails not sending.

It is an issue with Magento, all other apps work just fine.

They need to work on this asap for people as this is becoming a huge issue.

I can’t stress it enough.

 
Magento Community Magento Community
Magento Community
Magento Community
 
phazlett
Jr. Member
 
Total Posts:  21
Joined:  2008-06-21
Celebration, FL
 

I got my Gmail SMTP working in Magento 1.1.3 by changing /app/code/core/Zend/Mime.php

const LINEEND "";
to
const LINEEND '\n';

And following the previous post for changing /app/code/core/Mage/Core/Model/Email/Template.php to use TLS and port 587.

 
Magento Community Magento Community
Magento Community
Magento Community
 
JB7TS
Jr. Member
 
Total Posts:  1
Joined:  2008-08-08
 

Hi i get successful to use internal smtp account login( or external also if you need it’s the same ) to send mail.

I use Magento 1.1.3

My problem was that i received the mail sent to account of the server where magento run. But sending to external mail address i get back the email beacouse of anonymous sender.

I Think it works also with external smtp account.

Here is the modify list i’ve done:

1) Modify FILE: app/code/core/Zend/Mime.php

Change line 42: 

const LINEEND "";
with
const LINEEND "\n";

IMPORTANT: leave double quotes FOR “\n”

2) ModifyFILE: app/code/core/Mage/Core/Model/Email/Template.php

2a) New getMail() function (added a block of code to specify smtp config):

public function getMail()
    
{
        
if (is_null($this->_mail)) {

           
/*Start of added code to specify config*/
           
$my_smtp_host Mage::getStoreConfig('system/smtp/host');  // Take it from Magento backoffice or you can specify it here
           
$my_smtp_port Mage::getStoreConfig('system/smtp/port');    // Take it from Magento backoffice or you can specify it here
       
           
$config = array(
                    
'ssl' => 'tls'//optional
                    
'port' => $my_smtp_port//optional - default 25
                    
'auth' => 'login'
                    
'username' => 'mailaccount@domain.com',
                    
'password' => 'password'
                
);
                
            
$transport = new Zend_Mail_Transport_Smtp($my_smtp_host$config);
            
            
Zend_Mail::setDefaultTransport($transport);
            
/*End of added code to specify config*/
              
            
$this->_mail = new Zend_Mail('utf-8');
        
}
        
return $this->_mail;
    
}

2b) Comment those lines into send() function:

//ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
//ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));

Hope to be usefull to someone.

Bye

 
Magento Community Magento Community
Magento Community
Magento Community
 
Matthew J Mucklo
Jr. Member
 
Total Posts:  2
Joined:  2008-06-07
 

I had little success with Magento’s built in mailer, even with the suggestions to customize Transport.php / modify Zend/Mime.php

I’ve been working on a personal machine going out through Comcast for demo/testing purposes, however even setting it to go out through comcast.net’s mailservers, with the authentication as recommended in other posts didn’t work.

I ended up sniffing the packets and found two main problems.

The first problem was that it seemed to get stuck sending the DATA section, it would authenticate fine, then stick, I think eventually the TCP/IP or SMTP connection would time out (the browser would seem to hang for a while).

The second problem I ran into (some time afterwards, and I’m not sure why this one happened) was some how it was messing up the MAIL FROM: line, saying “MAIL FROM: <Owner <myemailaddress@comcast.net>>” (note the multiple ‘<’ and ‘>’ characters) when it should have said “MAIL FROM: Owner <myemailaddress@comcast.net>”

I ended up using PHPMailer version 2.1 (for PHP5) and replaced all of the Zend mailer code with the appropriate PHP Mailer calls and it worked (I did do this in a custom module, overriding the Core/Model/Email/Template.php send method, although it would probably work inline under the core, if you want to hack the core—I didn’t because I didn’t want my code to get overridden in some future upgrade that might touch that file—again if you want to hack the core, it will probably work as long as you put the PHPMailer classes, plus its language directory in an appropriate place).

Hallelujah after several days at this.  And THANK GOD for PHPMailer!

p.s. I could probably assist someone if they need help with this, send me a note.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mediagang
Sr. Member
 
Avatar
Total Posts:  111
Joined:  2008-01-16
Leeds UK
 

Having the same problem, not able to send emails out.  Running on a windows machine with magento 1.1.4.  Came across this extension which adds advanced smtp details to the admin:

http://www.magentocommerce.com/extension/460/advanced-smtp--artson.it

However, still not had a luck getting emails to send.  Not sure how what settings to use and there is no documenation to go with it. 

Maybe someone here can work it out…

 
Magento Community Magento Community
Magento Community
Magento Community
 
chantre84
Jr. Member
 
Total Posts:  9
Joined:  2008-06-04
 

After days I got the transactional emails to work:
I used Miro’s Code (from Page1) and commented ‘ssl’ => ‘tls’ out… this line created a STARTTLS error in my SMTP-Engine.

$config = array(
     
//'ssl' => 'tls',
     
'port' => Mage::getStoreConfig('system/smtp/port'), //optional - default 25
     
'auth' => 'login',
     
'username' => 'account@maildomain.com',
     
'password' => 'password'
     
);

Hope this can help someone else!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hercilio Costa
Member
 
Total Posts:  59
Joined:  2008-07-15
 
JB7TS - 04 September 2008 06:40 AM

Hi i get successful to use internal smtp account login( or external also if you need it’s the same ) to send mail.

I use Magento 1.1.3

My problem was that i received the mail sent to account of the server where magento run. But sending to external mail address i get back the email beacouse of anonymous sender.


I Think it works also with external smtp account.


Here is the modify list i’ve done:


1) Modify FILE: app/code/core/Zend/Mime.php

Change line 42: 

const LINEEND "";
with
const LINEEND "\n";

IMPORTANT: leave double quotes FOR “\n”


2) ModifyFILE: app/code/core/Mage/Core/Model/Email/Template.php

2a) New getMail() function (added a block of code to specify smtp config):

public function getMail()
    
{
        
if (is_null($this->_mail)) {

           
/*Start of added code to specify config*/
           
$my_smtp_host Mage::getStoreConfig('system/smtp/host');  // Take it from Magento backoffice or you can specify it here
           
$my_smtp_port Mage::getStoreConfig('system/smtp/port');    // Take it from Magento backoffice or you can specify it here
       
           
$config = array(
                    
'ssl' => 'tls'//optional
                    
'port' => $my_smtp_port//optional - default 25
                    
'auth' => 'login'
                    
'username' => 'mailaccount@domain.com',
                    
'password' => 'password'
                
);
                
            
$transport = new Zend_Mail_Transport_Smtp($my_smtp_host$config);
            
            
Zend_Mail::setDefaultTransport($transport);
            
/*End of added code to specify config*/
              
            
$this->_mail = new Zend_Mail('utf-8');
        
}
        
return $this->_mail;
    
}




2b) Comment those lines into send() function:

//ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
//ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));



Hope to be usefull to someone.

Bye

It works. Thanks JB7TS.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andre Xori
Member
 
Avatar
Total Posts:  70
Joined:  2008-05-02
 

I’ve tried EVERYTHING and nothing works to me. I’ve tried these codes above, but nothing happens… just:
“Unable to submit your request. Please, try again later”

I’ve tried this plugin:
http://www.magentocommerce.com/extension/460/advanced-smtp--artson.it

It shows some specific fields to use smtp, but didn’t work to me.
I can’t send email through mail() nor SMTP. I don’t know what to try anymore................ =`(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andre Xori
Member
 
Avatar
Total Posts:  70
Joined:  2008-05-02
 

Just to complement about my situation… The Contact Form works fine…
But the email Order confirmation don’t.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andre Xori
Member
 
Avatar
Total Posts:  70
Joined:  2008-05-02
 

Its me again… hehe Some curiosity.

My Host said the mail() - php function - only works if the FROM field in the header is some email hosted in my server(avesportes.com), if not, the function doesn’t work.

So if I tried to buy something with another email, eg. , I don’t get any email confirmation(as a Costumer nor Administrator).
BUT if I use some email hosted, eg. , it works! But I still don’t get the confirmation(as a Administrator)… Just as a Costumer.

Its really strange. And I tried ALL codes to do the SMTP work, but unsuccessfully…

Was it clear to understand?
Any ideas people?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hercilio Costa
Member
 
Total Posts:  59
Joined:  2008-07-15
 

Olá André. Pelo teu site suponho que sejas português. Esse era o mesmo problema que eu tinha: o meu servidor só enviava mails com o from com um domínio daquela máquina. Consegui contornar o problema com a solução do JB7TS. Tenta aplicar novamente essa solução calmamente e verificando todos os promenores. Basicamente o que estás a fazer com essa solução é autenticares-te perante o servidor, o que normalmente é suficiente para enviar o e-mail.

Cumprimentos,
Hercílio Costa

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andre Xori
Member
 
Avatar
Total Posts:  70
Joined:  2008-05-02
 

Olá Hercilio, Sou brasileiro na verdade… smile
Obrigado pela resposta. Vi que aquela solução funcionou para você. Eu
fiz EXATAMENTE o que pede lá mas o email não envia.

Quando faço aquelas configurações a loja sabe que deve enviar através
do SMTP ao invés do mail()?  Pq não funciona....... :(
Já não sei mais o que fazer. Obrigado pela atenção.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vadimc
Sr. Member
 
Avatar
Total Posts:  87
Joined:  2008-10-25
London
 
Hercilio Costa - 15 October 2008 02:17 AM



It works. Thanks JB7TS.

same thing here - thanks a lot, all sorted!

 
Magento Community Magento Community
Magento Community
Magento Community
 
vadimc
Sr. Member
 
Avatar
Total Posts:  87
Joined:  2008-10-25
London
 

I was able to narrow down the problem to my host. I had ubuntu and it didnt want to send emails without this hack. and even with this hack, it didnt want to send newsletters.
So guess what? I switched the server this weekend to a different provider that uses CentOS, reinstalled it all and now it works like a charm!
Btw, if anyone is looking for a good dedicated affordable host in the UK, i found http://www.Coreix.net that install all the latest php/zend optimiser/apache etc - i only had to install PDO_Mysql myself to get magento working and they pointed me into the right direction to do that. I am sure if you specify this to be installed, it will be done too!
cant be happier now, compared to the old ubuntu and webfusion, its like a breath of fresh air.
whoohooo!!!!

I will post soon my web when we finish development next week! In mean time, if you like to have a read about my nightmare with webfusion, please check it out on my blog: http://www.vadim.co.uk/blog/static/298

Stay everyone away from them, unless you are particularly looking to entertain yourself by observing people’s stupidity smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
alex.bsc
Guru
 
Total Posts:  340
Joined:  2008-06-06
 

Any news on an official release to allow you to use an external smtp server? i.e. google apps?
I ask as the mail server used on the current server is prone to have it’s email marked as SPAM and this is absolutely disastrous.  I need to use my google apps smtp server!

varien, let us know.. we appreciate everything takes man hours..
twiddling my thumbs as i wait for all the hard work to come to fruition…

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