On my small WordPress site I'm attempting to mail() the creation of a function yet it's neglecting to return the output and can return hard coded results placed within the while loop.
Basically things i am asking is exactly what within this code is wrong and just how will i repair it. I'd prefer to be tutored with what I've done wrong than "Have fixed code copy" if whatsoever possible.
I'm intentionally trying to step back from built-in WordPress functions and calls
echo $string; it shows using the expected output formatted when i intended, using the exclusion from the contents between
The functions are fetching the information correctly it simply isn't being incorporated within the email to become sent, that is being sent it simply seems blank. When sent as plaintext the e-mail contents are the following
<html><br /><br /></html>
I simply looked over the creation of the code, using the intent of exhibiting it for you so that you can begin to see the outcome and that i observed this is incorporated in-place of all of the outputted emails, because of a "bonus feature" of 1 of my plug ins, I don't know which, because this is nothing I've coded. Incorporated inline because of not meeting status needs to publish a lot more than two hyperlinks.
To the very best of my understanding scripts can't be run in emails, but surely this could not result in a failure to show the relaxation from the code, just render the scripts useless.
mail($to, 'Test', $string, $headers) ;
ought to be
$sent = mail($to, 'Test', $string, $headers) ;
This is exactly why it keeps saying the mail isn't sent. It's been sent however, you did not set the variable you're checking.