WordPress SMTP EMail

Eu tenho esse plugin no wordpress e já configure a class-phpmailer.php para enviar e-mails pelo SMTP. A minha hospedagem só aceita emails SMTP. Quando me registro no wordpress, recebo um e-mail, quando entrei em contato com o usuário, ele recebe e-mails. Isso está bem.

Mas quando eu tento usar esse plugin, ele não envia nenhum e-mail. Você poderia me ajudar por favor? Agradeço antecipadamente

 0){ $date_format = 'd/m/Y'; // 25/12/2011 }else{ $date_format = 'd/m/Y'; // 12/25/2011 } update_option('date_format',$date_format); } // get config $site_url = get_option ('siteurl'); $from = get_option ('admin_email'); $blog_name = get_option ('blogname'); $logo = get_option ('cp_logo'); $date_format = get_option ('date_format'); $link_edit = $site_url.'/'.get_option ('cp_edit_item_url').'/?aid='; $subject = get_option ('adsstatsemail_subject'); $header = get_option ('adsstatsemail_header'); $footer = get_option ('adsstatsemail_footer'); $campaign = 'utm_source=Weekly%20Ads%20Stats&utm_medium=email&utm_campaign='.urlencode(get_option ('adsstatsemail_campaign')); $ad_title = get_option ('adsstatsemail_adtitle'); $ad_week = get_option ('adsstatsemail_adweek'); $ad_total = get_option ('adsstatsemail_adtotal'); $ad_expire = get_option ('adsstatsemail_adexpire'); $ad_edit = get_option ('adsstatsemail_adedit'); update_date_format(); $week_start = time()-(86400*6); // replace macros $header = str_replace ("\n\n", "
", $header); $header = str_replace ('{date_from}', date($date_format, $week_start), $header); $header = str_replace ('{today}', date($date_format), $header); $header = str_replace ('{site_link}', "{$site_url}


", $header); $header = str_replace ('{site_logo}', "


", $header); $footer = str_replace ("\n\n", "
", $footer); $footer = str_replace ('{date_from}', date($date_format, $week_start), $footer); $footer = str_replace ('{today}', date($date_format), $footer); $footer = str_replace ('{site_link}', "{$site_url}", $footer); $footer = str_replace ('{site_logo}', "", $footer); // fetch ad info $sql = " SELECT p.ID, p.post_title, p.post_date, pm.meta_value AS expireDate, u.user_email, u.display_name, t.postcount AS total, SUM(d.postcount) AS week FROM wp_posts as p INNER JOIN wp_postmeta AS pm ON p.ID=pm.post_id AND pm.meta_key = 'cp_sys_expire_date' INNER JOIN wp_users AS u ON u.ID=p.post_author INNER JOIN wp_cp_ad_pop_total AS t ON t.postnum=p.ID INNER JOIN wp_cp_ad_pop_daily AS d ON d.postnum=p.ID AND d.time >= DATE_SUB(NOW(), INTERVAL 1 WEEK) WHERE p.post_type = 'ad_listing' GROUP BY p.ID ORDER BY u.ID "; $sth = $db->query ($sql); $list = array (); while ($row = $sth->fetch (PDO::FETCH_ASSOC)) { // remove expired ads if (strtotime($row['expireDate']) <= $week_start) { continue; } $mail = $row['user_email']; unset ($row['user_email']); $list[$mail][] = $row; } // prepend header $header = " {$header} "; // footer $footer = "
{$ad_title} {$ad_week}   {$ad_total}   {$ad_expire}
{$footer} "; $count = 0; foreach ($list as $email => $ads) { $html = $header; foreach ($ads as $ad) { $ad['expireDate'] = date($date_format, strtotime ($ad['expireDate'])); $ad['post_title'] = utf8_encode($ad['post_title']); $html .= " {$ad['post_title']}   {$ad['week']} {$ad['total']} {$ad['expireDate']} {$ad_edit} "; } $html .= $footer; $headers = "From: {$blog_name} \r\nMIME-Version: 1.0\r\nContent-type: text/html; charset=utf-8\r\n"; mail ("{$ad['display_name']} ", $subject, $html, $headers); echo "$email\n"; $count++; } echo "\nDone ($count emails).\n\n";

Solutions Collecting From Web of "WordPress SMTP EMail"