WP stopped emailing notifications about new comments

Yes, earlier WordPress used to send notification on new comment. Not sure if that has been removed in latest version. I faced the same problem so I started using Better Notifications for WordPress plugin. I think you shall also use this.

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

Send email daily using `wp_mail`

I would explore the use of scheduled events in WorPdress, known as wp-cron. Here is a example for that (not tested, just written here as proof of concept): // 1.- Register custom escheduled event on plugin activiation register_activation_hook( __FILE__, ‘cyb_plugin_activation’ ); function cyb_plugin_activation() { if( ! wp_next_scheduled( ‘cyb_daily_cron_job’ ) ) { // Set first run … Read more

Send email messages after comment was submitted

For comment approved, you can review this question Approve comment hook? For comment submitted, you can hook into the comment_post hook, like function show_message_function( $comment_ID, $comment_approved ) { if( 0 === $comment_approved ){ //function logic goes here } } add_action( ‘comment_post’, ‘show_message_function’, 10, 2 ); Code copied from https://developer.wordpress.org/reference/hooks/comment_post/

Sending email for the custom form in WordPress

The easy way would install this plugin – https://da.wordpress.org/plugins/contact-form-7/ – It’s super easy to work with, and it will do what you want 🙂 If you don’t want to use a plugin, then you would just code a contact form with html and php. PHP: <?php $firstname = $_POST[‘firstname’]; $lastname = $_POST[‘lastname’]; $from = $_POST[’email’]; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)