Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I try to use wp_mail (testing on local machine) but no mail is received. the php.ini has smtp_port = 25 set and the php mail() is working so far.

  • how can I check if wp_mail is working
  • what can fail

Here is the code of my mail function:

function mv_optin_mail($id, $data){

    $url = $id."-".mv_mail_token($id, $data['token']);

    add_filter( 'wp_mail_content_type', 'set_html_content_type' );
    add_filter( 'wp_mail_charset', 'utf8' );

    $headers[] = 'From: '.sender_signature.' <'.noreply_address.'>';    

    $html_mail = ob_get_contents();

    wp_mail( $data['email'], 'Some Subject', $html_mail, $headers );
    remove_filter( 'wp_mail_content_type', 'set_html_content_type' );
    remove_filter( 'wp_mail_charset', 'utf8' );

I don't get any errors. Is there a way to toggle error-loggin for wordpress?

the noreply_address is noreply@root

share|improve this question
Now the remaining questions are: What is mv_mail_token() and what does it return and where does the constant sender_signature come from and what does it contain? –  kaiser Jun 23 '13 at 18:01
Kaiser, listen, please try to answer the questions ... wp_mail_token() returns a string and sender_signature does at well. –  helle Jun 24 '13 at 8:38
debug gist –  kaiser Jun 24 '13 at 9:02
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.