0

I am trying to send an email and parse its contents using WP_Mail but the email is not sending, I am just not getting an error message on the page. Can someone tell me if there is something wrong with my function?

<?php 

    //lets get the redem voucher email that will go to both the user and                    
  $replacements = array(
'({playerId})' => $playerId,    
'({message_body})' => nl2br( stripslashes(  $ggs['player-redeem'] ) )
 );
$message = preg_replace( array_keys( $replacements ), array_values( $replacements ),  $ggs['player-redeem']);


//Handle some basic validation
$errors = array();

//Assigning a picture for {logo} replacement
$logo = 'http://fundrasing.davidbuckleyni.co.uk/wp-content/themes/gogreensoccer3/images/logo.png';
$headers = 'From: My Name <test@test.co.uk>' . "\r\n";
//Send the message assigned to a var so we can output
$status = send_message( 'test@test.co.uk', 'test@test.co.uk', 'Player Wants to Redeem Points', $message, $logo );

I just used the default wp_mail but its not being sent as test

wp_mail( 'test@test.co.uk', 'The subject', 'The message' );  

I do get other emails from the system so I know it is setup OK.

0

If you assign wp_mail() to a variable you can echo the results. Should return either true or false.

$email = wp_mail(email,subject,message);
var_dump($email);

I don't recognise the send_message() function in your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.