Send email via ajax
You need to allow AJAX requests for guests too. Usually when a WordPress AJAX call returns 0, it means that there are no capabilities for the user to perform that action. Also, your debug info showed Guest. Alter your function to include the nopriv AJAX for guests: add_action(‘wp_ajax_nopriv_fahadsending_mail’, ‘fahadsending_mail’); add_action(‘wp_ajax_fahadsending_mail’, ‘fahadsending_mail’); function fahadsending_mail(){ $to = … Read more