I am sending email with the
wp_mail() function but it is not working. It is returning false. Also it is not giving any error in the server log.
This is my code:
$mailResult = false; $to = "firstname.lastname@example.org"; $subject = "HUDPowerBid Mailgun Test exec on "; $message = "Testing Mailgun at: "; $mailResult = wp_mail( $to, $subject, $message, $headers); $myarr= array('error' => true, 'mail' => $mailResult);
I have also tried with the above code and below code also I have tried with these two codes at once but nothing is working
$to1 = 'email@example.com'; $subject1 = 'Post Published by Author'; $headers1 = 'From: admin <firstname.lastname@example.org>' . "\r\n"; $message1 = 'your'; $a=wp_mail($to1, $subject1, $message1, $headers1); $my=array('checkstatus'=>$a,'second'=>$mailResult); echo json_encode($my);