Error in return JSON PHP for AJAX

1

I can not return success, it is always falling into error. The server side seems to be ok, the email is sent correctly, I just can not display the success and I do not understand why.

PHP

header('Content-type: application/json');

// DISABLE THEME AND LOAD CLASSES WP
define('WP_USE_THEMES', false);
require('../../../wp-load.php');

// RETURN VALUE OF QUERIE
$data['assunto']    = 'Contato Site';
$data['nome']       = $_POST['valores'][0]['value'];
$data['telefone']   = $_POST['valores'][1]['value'];
$data['email']      = $_POST['valores'][2]['value'];
$data['mensagem']   = $_POST['valores'][3]['value'];

// LOAD WP EMAIL ADMIN AND BLOG NAME
$mailuser = get_option('admin_email');
$sitename = get_option('blogname');

// MOUNT MESSAGE HTML
$msgSend = '<h3 style="font:16px Arial, Helvetica, sans-serif; color:#000;">Contato recebido através do site '.$sitename.'</h3><p style="font:14px Arial, Helvetica, sans-serif; color:#333333;"><strong>Nome:</strong> '.$data['nome'].'<br/><strong>Assunto:</strong> '.$data['assunto'].'<br/><strong>Telefone:</strong> '.$data['telefone'].'<br/><strong>E-mail:</strong> '.$data['email'].'<br/><p style="font:bold 14px Arial, Helvetica, sans-serif; color:#333333;">Mensagem:</p><hr style="color:#666666;border:0;"><p style="font:14px Arial, Helvetica, sans-serif; color:#666666;">'.nl2br($data['mensagem']).'</p><hr style="color:#666666;border:0;"><br/><p style="font:14px Arial, Helvetica, sans-serif; color:#333333;"><strong>Data:</strong> '.date('d/m/Y H:i').'<br/><strong>IP:</strong> '.$_SERVER["REMOTE_ADDR"].'</p>';

// SEND E-MAIL WITH DATA POSTED
$send = sendMail( $data['assunto'], $msgSend, $mailuser, $sitename, $mailuser, $sitename, $data['email'], $data['nome'] );

if( $send ){
    $response_array['status'] = 'success';  
} else {
    $response_array['status'] = 'error';  
}

echo json_encode( $response_array );

AJAX

$.ajax({
            url : 'http://localhost:8888/sis/wp-content/themes/sis/sendform.php',
            type: 'POST',
            dataType : 'json',
            data: { 'valores' : valores },

            success : function( ret ){

                console.log( ret );

                $('.sub-content-form').hide();

                var messageEl = theForm.querySelector( '.final-message' );
                messageEl.innerHTML = 'Agradecemos seu contato, retornaremos o mais breve possível =D';
                classie.addClass( messageEl, 'show' );

            }, 

            error : function( ret ){
                console.log( ret );
            }

        });

Debugging on the console I only received this when I get into the error

    Object {readyState: 4, responseText: "<br />↵<font size='1'><table class='xdebug-error x…36</td></tr>↵</table></font>↵{"status":"success"}", status: 200, statusText: "OK"}abort: (a){var b=a||u;return j&&j.abort(b),c(0,b),this}always: (){return e.done(arguments).fail(arguments),this}complete: (){if(i){var d=i.length;!function f(b){ea.each(b,function(b,c){var d=ea.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=i.length:c&&(h=d,k(c))}return this}done: (){if(i){var d=i.length;!function f(b){ea.each(b,function(b,c){var d=ea.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=i.length:c&&(h=d,k(c))}return this}error: (){if(i){var d=i.length;!function f(b){ea.each(b,function(b,c){var d=ea.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=i.length:c&&(h=d,k(c))}return this}fail: (){if(i){var d=i.length;!function f(b){ea.each(b,function(b,c){var d=ea.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=i.length:c&&(h=d,k(c))}return this}getAllResponseHeaders: (){return 2===t?g:null}getResponseHeader: (a){var b;if(2===t){if(!k)for(k={};b=Lb.exec(g);)k[b[1].toLowerCase()]=b[2];b=k[a.toLowerCase()]}return null==b?null:b}overrideMimeType: (a){return t||(l.mimeType=a),this}pipe: (){var a=arguments;return ea.Deferred(function(c){ea.each(b,function(b,f){var g=ea.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&ea.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()}progress: (){if(i){var d=i.length;!function f(b){ea.each(b,function(b,c){var d=ea.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=i.length:c&&(h=d,k(c))}return this}promise: (a){return null!=a?ea.extend(a,d):d}readyState: 4responseText: "<br />↵<font size='1'><table class='xdebug-error xe-deprecated' dir='ltr' border='1' cellspacing='0' cellpadding='1'>↵<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php on line <i>1727</i></th></tr>↵<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>↵<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>↵<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0010</td><td bgcolor='#eeeeec' align='right'>250216</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>0</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.4623</td><td bgcolor='#eeeeec' align='right'>17756224</td><td bgcolor='#eeeeec'>sendMail(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>24</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18273672</td><td bgcolor='#eeeeec'>PHPMailer->Send(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/functions.php' bgcolor='#eeeeec'>../functions.php<b>:</b>285</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18275088</td><td bgcolor='#eeeeec'>PHPMailer->CreateHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>558</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18276152</td><td bgcolor='#eeeeec'>PHPMailer->AddrAppend(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1096</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18276752</td><td bgcolor='#eeeeec'>PHPMailer->AddrFormat(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>901</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18277240</td><td bgcolor='#eeeeec'>PHPMailer->EncodeHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>918</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18278192</td><td bgcolor='#eeeeec'>PHPMailer->EncodeQ(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1566</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.4693</td><td bgcolor='#eeeeec' align='right'>18278592</td><td bgcolor='#eeeeec'><a href='http://www.php.net/function.preg-replace' target='_new'>preg_replace</a>↵(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1727</td></tr>↵</table></font>↵<br />↵<font size='1'><table class='xdebug-error xe-deprecated' dir='ltr' border='1' cellspacing='0' cellpadding='1'>↵<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php on line <i>1727</i></th></tr>↵<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>↵<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>↵<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0010</td><td bgcolor='#eeeeec' align='right'>250216</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sen…td><td bgcolor='#eeeeec' align='right'>18278344</td><td bgcolor='#eeeeec'>PHPMailer->AddrAppend(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1106</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.4728</td><td bgcolor='#eeeeec' align='right'>18278864</td><td bgcolor='#eeeeec'>PHPMailer->AddrFormat(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>901</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.4729</td><td bgcolor='#eeeeec' align='right'>18279024</td><td bgcolor='#eeeeec'>PHPMailer->EncodeHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>918</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.4729</td><td bgcolor='#eeeeec' align='right'>18279888</td><td bgcolor='#eeeeec'>PHPMailer->EncodeQ(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1566</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.4729</td><td bgcolor='#eeeeec' align='right'>18280288</td><td bgcolor='#eeeeec'><a href='http://www.php.net/function.preg-replace' target='_new'>preg_replace</a>↵(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1727</td></tr>↵</table></font>↵<br />↵<font size='1'><table class='xdebug-error xe-deprecated' dir='ltr' border='1' cellspacing='0' cellpadding='1'>↵<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php on line <i>1736</i></th></tr>↵<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>↵<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>↵<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0010</td><td bgcolor='#eeeeec' align='right'>250216</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>0</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.4623</td><td bgcolor='#eeeeec' align='right'>17756224</td><td bgcolor='#eeeeec'>sendMail(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>24</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18273672</td><td bgcolor='#eeeeec'>PHPMailer->Send(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/functions.php' bgcolor='#eeeeec'>../functions.php<b>:</b>285</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18275088</td><td bgcolor='#eeeeec'>PHPMailer->CreateHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>558</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.4747</td><td bgcolor='#eeeeec' align='right'>18278512</td><td bgcolor='#eeeeec'>PHPMailer->EncodeHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1124</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.4747</td><td bgcolor='#eeeeec' align='right'>18279424</td><td bgcolor='#eeeeec'>PHPMailer->EncodeQ(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1566</td></tr>↵<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.4747</td><td bgcolor='#eeeeec' align='right'>18279872</td><td bgcolor='#eeeeec'><a href='http://www.php.net/function.preg-replace' target='_new'>preg_replace</a>↵(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1736</td></tr>↵</table></font>↵{"status":"success"}"setRequestHeader: (a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this}state: (){return c}status: 200statusCode: (a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this}statusText: "OK"success: (){if(i){var d=i.length;!function f(b){ea.each(b,function(b,c){var d=ea.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=i.length:c&&(h=d,k(c))}return this}then: (){var a=arguments;return ea.Deferred(function(c){ea.each(b,function(b,f){var g=ea.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&ea.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()}__proto__: Object
functions.min.js?ver=1.0:1 parsererror
functions.min.js?ver=1.0:1 SyntaxError: Unexpected token <
    at Object.parse (native)
    at ea.parseJSON (http://localhost:8888/sis/wp-content/themes/sis/_/js/jquery.min.js?ver=2.1.3:3:18657)
    at R (http://localhost:8888/sis/wp-content/themes/sis/_/js/jquery.min.js?ver=2.1.3:1:10878)
    at c (http://localhost:8888/sis/wp-content/themes/sis/_/js/jquery.min.js?ver=2.1.3:3:20417)
    at XMLHttpRequest.ea.ajaxTransport.send.b (http://localhost:8888/sis/wp-content/themes/sis/_/js/jquery.min.js?ver=2.1.3:3:26935)
    
asked by anonymous 27.05.2015 / 17:08

4 answers

0

Staff solved the problem and thanks for the help, until I can get to the solution, like this:

I updated the library: link

And I used the autoloader that in the current version is recommended.

The problem was also in this mail-> Host configuration, where it did not accept my primary SMTP address, worked with IP or with a secondary name (I do not know why).

    
27.05.2015 / 22:16
1

What is the PHP version? An error occurs because the preg_replace () / and modifier function has been deprecated in versions 5.5.x and must be replaced by the preg_replace_callback () function. The error itself is reporting this:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php on line 1727

Concert this line and try again.

    
27.05.2015 / 19:11
1

With the result of your log I came to the following conclusion.

Your class.phpmailer.php is outdated and still uses a php phantom function called preg_replace() .

Error Details

<br />
<font size='1'>
<table class='xdebug-error xe-deprecated' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php on line <i>1727</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0010</td><td bgcolor='#eeeeec' align='right'>250216</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.4623</td><td bgcolor='#eeeeec' align='right'>17756224</td><td bgcolor='#eeeeec'>sendMail(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>24</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18273672</td><td bgcolor='#eeeeec'>PHPMailer->Send(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/functions.php' bgcolor='#eeeeec'>../functions.php<b>:</b>285</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18275088</td><td bgcolor='#eeeeec'>PHPMailer->CreateHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>558</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18276152</td><td bgcolor='#eeeeec'>PHPMailer->AddrAppend(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1096</td></tr><tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18276752</td><td bgcolor='#eeeeec'>PHPMailer->AddrFormat(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>901</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18277240</td><td bgcolor='#eeeeec'>PHPMailer->EncodeHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>918</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.4692</td><td bgcolor='#eeeeec' align='right'>18278192</td><td bgcolor='#eeeeec'>PHPMailer->EncodeQ(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1566</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.4693</td><td bgcolor='#eeeeec' align='right'>18278592</td><td bgcolor='#eeeeec'><a href='http://www.php.net/function.preg-replace' target='_new'>preg_replace</a>
(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1727</td></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error xe-deprecated' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php on line <i>1727</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0010</td><td bgcolor='#eeeeec' align='right'>250216</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sen…td><td bgcolor='#eeeeec' align='right'>18278344</td><td bgcolor='#eeeeec'>PHPMailer->AddrAppend(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1106</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.4728</td><td bgcolor='#eeeeec' align='right'>18278864</td><td bgcolor='#eeeeec'>PHPMailer->AddrFormat(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>901</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.4729</td><td bgcolor='#eeeeec' align='right'>18279024</td><td bgcolor='#eeeeec'>PHPMailer->EncodeHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>918</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.4729</td><td bgcolor='#eeeeec' align='right'>18279888</td><td bgcolor='#eeeeec'>PHPMailer->EncodeQ(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1566</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.4729</td><td bgcolor='#eeeeec' align='right'>18280288</td><td bgcolor='#eeeeec'><a href='http://www.php.net/function.preg-replace' target='_new'>preg_replace</a>
(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1727</td></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error xe-deprecated' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php on line <i>1736</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0010</td><td bgcolor='#eeeeec' align='right'>250216</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.4623</td><td bgcolor='#eeeeec' align='right'>17756224</td><td bgcolor='#eeeeec'>sendMail(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/sendform.php' bgcolor='#eeeeec'>../sendform.php<b>:</b>24</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18273672</td><td bgcolor='#eeeeec'>PHPMailer->Send(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/functions.php' bgcolor='#eeeeec'>../functions.php<b>:</b>285</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.4690</td><td bgcolor='#eeeeec' align='right'>18275088</td><td bgcolor='#eeeeec'>PHPMailer->CreateHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>558</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.4747</td><td bgcolor='#eeeeec' align='right'>18278512</td><td bgcolor='#eeeeec'>PHPMailer->EncodeHeader(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1124</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.4747</td><td bgcolor='#eeeeec' align='right'>18279424</td><td bgcolor='#eeeeec'>PHPMailer->EncodeQ(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1566</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.4747</td><td bgcolor='#eeeeec' align='right'>18279872</td><td bgcolor='#eeeeec'><a href='http://www.php.net/function.preg-replace' target='_new'>preg_replace</a>
(  )</td><td title='/Applications/MAMP/htdocs/sis/wp-content/themes/sis/inc/class.phpmailer.php' bgcolor='#eeeeec'>../class.phpmailer.php<b>:</b>1736</td></tr>
</table></font>

Solution

Replace your class.phpmailer.php with preg_replace() with preg_replace_callback()

    
27.05.2015 / 19:18
0

I do not know what your sendMail function does, but your html looks like this:

$msgSend = '
<h3 style="font:16px Arial, Helvetica, sans-serif; color:#000;">
    Contato recebido através do site '.$sitename.'
</h3>
<p style="font:14px Arial, Helvetica, sans-serif; color:#333333;">
    <strong>Nome:</strong> '.$data['nome'].'<br/>
    <strong>Assunto:</strong> '.$data['assunto'].'<br/>
    <strong>Telefone:</strong> '.$data['telefone'].'<br/>
    <strong>E-mail:</strong> '.$data['email'].'<br/>
    <p style="font:bold 14px Arial, Helvetica, sans-serif; color:#333333;">
        Mensagem:
    </p>
    <hr style="color:#666666;border:0;">
    <p style="font:14px Arial, Helvetica, sans-serif; color:#666666;">
        '.nl2br($data['mensagem']).'
    </p>
    <hr style="color:#666666;border:0;"><br/>
    <p style="font:14px Arial, Helvetica, sans-serif; color:#333333;">
        <strong>Data:</strong> '.date('d/m/Y H:i').'<br/>
        <strong>IP:</strong> '.$_SERVER["REMOTE_ADDR"].'
    </p>';

As you can see, this is missing the tag term of p at the end </p> .

    
27.05.2015 / 18:24