functions – wp_mail() return false . waiting for response please or suggestions ou recommandations?

Question

public function send_newsletter()
{
global $wpdb;

    $recipients = $wpdb->get_results("SELECT email FROM {$wpdb->prefix}zero_newsletter_email");
    $object = get_option('zero_newsletter_object', 'Newsletter');
    $content = get_option('zero_newsletter_content', 'Mon contenu');
    $sender = get_option('zero_newsletter_sender', 'noreply@example.com'); 
    // Enverra la valeur de l'option et s'il n'a pas trouvé qu'il envoie le second paramètre
    $header = array('From: '.$sender);

    $result = wp_mail($recipients[0]->email, $object, $content, $header);
    var_dump($result); // false
}

0
gerard principe 2 weeks 2023-09-18T13:09:14-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse