Post by austinr » Wed May 27, 2015 11:32 pm

Hi all

I am a new Opencart users, I just installed 2 days ago since it came highly rated.
I am having a problem, I receive 0 mails (contact form/test orders) from the software.

On my hosting server, I have 2 domains/ecommerce software. I have been using Cubecart for a few years, and everything works fine there (I checked the mail settings, its standard MAIL (php i believe), with port 25 and nothing else set. Everything works fine here).

So, on the same host with Opencart, no emails send at all (using MAIL option with port 25 just like the Cubecart install). I mention this because my webhost handles the email fine on the other software using php mail port 25, but with Opencart it doesn't work.

I tried a lot of solutions, -f, -Femailaddress
SMTP with correct settings on my mail configuration (using my SMTP details that work with mail client)

My mail host is hosted on my own domain, so I am not using google or anything like that would reject it. When I send a contact form on Opencart, everything appears to be fine using MAIL (php)
Contact Us

Your enquiry has been successfully sent to the store owner!
no error logs anywhere, no returned mail, nothing. Just no mail!

Please can anyone help me find out what is causing this problem and maybe some solutions. Thanks

PS: I also made some fake test orders on the site and no emails is received for the customer or admin.

Newbie

Posts

Joined
Wed May 27, 2015 11:24 pm

Post by austinr » Thu May 28, 2015 10:17 pm

update: I created this file on the server and ran it. The email send/delivered fine! So it seems my server/webhost is configured OK to send mail with php MAIL function.


https://www.conetix.com.au/support/arti ... -mail-test

Instructions

Create the test-email.php script with the following:

Code: Select all

      <?php
        ini_set( 'display_errors', 1 );
        error_reporting( E_ALL );
        $from = "emailtest@YOURDOMAIN";
        $to = "YOUREMAILADDRESS";
        $subject = "PHP Mail Test script";
        $message = "This is a test to check the PHP Mail functionality";
        $headers = "From:" . $from;
        mail($to,$subject,$message, $headers);
        echo "Test email sent";
        ?>
If you have a Virtual Private Server (VPS), login to the server to execute:

php test-email.php

Alternatively, place the file in your httpdocs directory so that it can be called from your website.
Check your email to ensure it has been delivered.
If you have the file publically accessible on your website, don't forget to delete it after testing is complete!

Newbie

Posts

Joined
Wed May 27, 2015 11:24 pm

Post by austinr » Fri May 29, 2015 4:21 am

Been searching through like 5 different PHP test mail scripts, all of them send mail perfectly fine from the server in question. So the host php mail seems to be working, this and my Cubecart store on the same server work fine with php mail, leads me to believe something is wrong with the Opencart software or configuration somehow.

mail.php is 644 permissions btw

Newbie

Posts

Joined
Wed May 27, 2015 11:24 pm

Post by austinr » Fri May 29, 2015 4:34 am

problem solved using this solution

http://stackoverflow.com/questions/1633 ... ion-emails

Change the file:

system/library/mail.php | line 97

Remove second $this->newline from code.


Not sure why this bug is still in version 2.0.2, seems like its a pretty old problem based on google search :/

Newbie

Posts

Joined
Wed May 27, 2015 11:24 pm

Post by austinr » Thu Jul 23, 2015 2:51 pm

ok, wanted to update this. I took a break from Opencart for a while, however updated to 2.0.3 recently, and now on my contact form was not sending messages (again).
So I went in and did the previous fix, and now the message would send, however the body would be empty in email client. So email sends, with subject fine, however empty/blank body.

The action I took, I reverted to 2.0.2 mail.php and, and then did the original fix (above, remove the extra newline), and now it works again.

Please fix the mail.php guys! opencart software is really good, I am learning to use it, but hesitant to invest money in the extensions since it seems like the software is being neglected which doesn't inspire confidence for the future. Having the mail work correctly is an absolutely core feature for any ecommerce platform, so I think more attention should be diverted to this area.

Newbie

Posts

Joined
Wed May 27, 2015 11:24 pm
Who is online

Users browsing this forum: No registered users and 14 guests