Emails once again

Hi, I thought I was done but there it is. Smtp is fine I believe. Upon order the admin receives the confirmation but the customer doesn’t. The recommendation email works but for example it doesn’t work from the order administration when I want to send the order shipped email.

When the customer is through with the order the sorry, we couldn’t send you an email at this time message comes up.

In the log file I see this, after trying to send the order shipped email:

oxException (time: 2016-05-30 06:21:04): [0]: Could not instantiate mail function.
Stack Trace: #0 /…/core/oxutilsobject.php(188): oxUtilsObject->_getObject(‘oxexception’, 0, Array)
#1 [internal function]: oxUtilsObject->oxNew(‘oxException’)
#2 /…/core/oxfunctions.php(371): call_user_func_array(Array, Array)
#3 /…/core/oxemail.php(2074): oxNew(‘oxException’)
#4 /…/core/oxemail.php(414): oxEmail->_sendMail()
#5 /…/core/oxemail.php(1096): oxEmail->send()
#6 /…/application/controllers/admin/order_overview.php(192): oxEmail->sendSendedNowMail(Object(InvoicepdfOxOrder))
#7 /…/core/oxview.php(522): Order_Overview->sendorder()
#8 /…/core/oxshopcontrol.php(347): oxView->executeFunction(‘sendorder’)
#9 …/core/oxshopcontrol.php(126): oxShopControl->_process(‘order_overview’, ‘sendorder’, NULL, NULL)
#10 /…/core/oxid.php(40): oxShopControl->start()
#11 /…/index.php(26): Oxid::run()
#12 /…/admin/index.php(27): require_once(’/mnt/data/accou…’)
#13 {main}

Which doesn’t say anything to me. I tried with localhost also, that didn’t work either. Sorry, I am out of ideas, please help.

I have CE 4.9.6.

The problem will be here, I just don’t know what this exactly means. When I activate the smtp debugging, I get this error:

Warning: Cannot modify header information - headers already sent by (output started at /…/core/phpmailer/class.smtp.php:799) in /…/core/oxutils.php on line 1133

"Cannot modify header information"
This is not a problem, debugging should work anyway. A good way to test mail function is “forgot password” function, because you can send it multiple times until it works without having to place an order. You should test different addresses inside and outside of your domain.

“Could not instantiate mail function”: In case smtp delivery fails, shop uses PHP mail() function as a fallback, and PHP mail() generates this error, probably mail() is not configured correctly on your server. This is not a problem because you want to use SMTP anyway. But something must be wrong with your SMTP server or settings, causing it to fallback to mail(), either wrong credentials, no relay allowed, server unavailable, greylisting active etc.

You also shouldn’t just look whether a mail arrives, because of the mail() fallback the mail can arrive even if SMTP fails, so you should have a look in the mailheader to see if it was really sent via the SMTP-Server you specified.

Hi, thanks, that was very useful.

The problem was that the “order email reply” had to be on the same server also which I didn’t expect since I thought it was reply to address only and didn’t need smtp. Anyway it seems to work now so thanks again.