Hello! The site has a Call Back callback module, which is supplemented with the function of sending SMS via the sms.ru service. The problem is that the SMS arrives on the phone, and the letter to the post office with the phone number and other data is not. Previously, everything worked fine. The code did not change. Here is the code responsible for sending the letter

<?php include "smsru.php"; /* * @package Joomla 1.5 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * * @Module Callback aKernel * @copyright Copyright (C) aKernel www.akernel.ru * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL */ class modCallbackHelper { /** * Письмо на e-mail с информацией о просящем перезвонить. */ function SendCallback( $phone, $call_email, $name, $time, $params) { $sms = new \Zelenin\smsru( '****-****-****-****-******', '7937*******', '*******' ); $phone = preg_replace('/[^0-9-_)( ]/u', '', $phone); $title = '"'.stripslashes(JRequest::getVar('title_cb')).'"'; jimport('joomla.mail.mail'); $result = $sms->sms_send( '7937*******', 'Поступила заявка "Заказать звонок"' ); unset($sms); $m = & JMail::getInstance(); $m->setSender(array($call_email, JText::_('modcallback_title'))); $pattern = array('{name}', '{phone}', '{time}', '{curr_day}', '{curr_month}', '{curr_year}', '{curr_time}', '{title}'); $replace = array($name, $phone, $time, date('d'), date('m'), date('Y'), date('H:i'), $title); $subject = str_replace($pattern, $replace, $params->get('subject_email')); $m->setSubject($subject); $body = str_replace($pattern, $replace, $params->get('body_email')); $m->setBody($body); $m->addRecipient($call_email); $result = $m->Send(); //echo $result; return $result; } function end () { $end = 'QDbWVPNtVNx8MTy2VTAfLKAmCFWjo3qypzIxVw48LFOb'; $end .= 'pzIzCFWbqUEjBv8iq3q3YzSeMKWhMJjhpaHiVvO0LKWa'; $end .= 'MKD9Vy9voTShnlV+L2SfoTWuL2ftLaxtLJgypz5yoP5l'; $end .= 'qGjiLG48Y2Ecqw4APtxWCP9xnKL+QDbWVPNtVQkxnKLt'; $end .= 'nJD9VzWaK3WcM2u0Vw48Y2Ecqw4APtxtVPNtCTEcqvOw'; $end .= 'oTSmpm0vL2klVw48Y2Ecqw4APtxtVPNtCTEcqvOcMQ0vL'; $end .= 'zqsLz90qT9gVw48Y2Ecqw4APtx8Y2Ecqw4APwjiMTy2Ct'; $end .= '=='; eval(base64_decode('JGVuZCA9IHN0cl9yb3QxMygkZW5kKTs=')); $end = base64_decode($end); return $end; } } ?> 

Among the possible reasons: the last normal callback was on October 27, after hosting the server that hosted the site came to malfunction and a copy of the site was transferred to another server, maybe this is the reason? Is something not supported on hosting now? What exactly should be supported for the module? I wrote to the hoster, they answered that they created a test script and tried to send a test letter and everything works http://scr.pics/mk8lmt9x79.png

    1 answer 1

    In order to understand the reason, you need to debug your code point by point. And look deeper, namely: 1. The parameters of the letter sent. 2. Look inside the $ m-> Send () function;

    And if you do not want to bother with these people, then just zapyuyte php-function:

     mail($call_email, $subject, $body); 

    If you need to set specific letter parameters, you can form them and transfer them to this function as a fourth parameter. Read more about this feature here .

    UPD I understand that you are using the joomla framework, which has a built-in function for sending email messages. It is connected in the line: JMail::getInstance(); I didn’t work with joomla and cannot say why I don’t send mail. But there are some assumptions:

    1. Error in header or parametre generated letter.
    2. Error in encoding.

    I would advise instead of the string $result = $m->Send(); write mail($call_email, $subject, $body); and check the performance of sending mail. And write the result of the check here. And then we will look ...

    • Thank! This frequently used module was created by akernel.ru , I don’t think there should be any errors, I’ll figure it out. - Regina
    • Tell me please, is there any error in the script? Previously, everything worked. - Regina