Page 1 of 1

Sending SMTP emails via opencart

Posted: Tue Jun 05, 2012 7:24 pm
by sabina
I am using SMTP, to send my emails, i have entered the details correctly on admin panel-> Settings-> Mail.
Host, username, password everything is correct, it sends an email also, but the only problem is the content of the email is not proper, its showing all html codes.
Can anyone help me to solve this issue?

Re: Sending SMTP emails via opencart

Posted: Sat Jun 09, 2012 2:16 pm
by Avvici
What is your version of Open Cart? That's not an SMTP problem. That sounds like a problem with how you are sending the mail. For example, if you don't send with correct headers, all html characters will show up.

Open cart can send mail two ways generally:

$mail->setHtml($html);
or
$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));

The first way is where you use an actual TPL for the template. You CANNOT use line breaks like \n because they will show up. Instead you use <br/>

The second way you actually would use \n and <br> would show up.

Re: Sending SMTP emails via opencart

Posted: Tue Jun 12, 2012 3:23 am
by sabina
Open Cart version is 1.4.0
if i use the Mail protocol to send my emails, i have no issues, only the problem comes when i change it to SMTP protocol, and then my email content is empty.
I have entered all the requird details correctly, host, username, passwrd, port etc.
What can be the issue? or i do i have to make some more changes in the code somwhere?
Please help me out.

Re: Sending SMTP emails via opencart

Posted: Tue Jun 12, 2012 5:15 am
by Avvici
Double check with your hosting provider that you are in fact entering the correct details. There isn't much support on here for SMTP besides the threads from people that had actually got it working well without bugs.. The list is small;)