Allow user to add the php code in wp_mail()

I would just use str_replace() to handle a “pseudo” shortcode. Something like this: $body = sprintf(‘Hey {{username}}, your awesome post has been published! See <%s>’, get_permalink($post) ); // Add replacement values to the array as necessary. $old = array( ‘{{username}}’ ); $new = array( esc_html($user->display_name) ); $body = str_replace( $old, $new, $body ); // Now … Read more

Premature end of script headers: wp-mail.php?

Post by email does not work by accessing wp-mail.php. You need to go to Settings > Writing on your website and enter POP3 credentials for whatever email address you plan to use. After that, any email you send TO that email address will be parsed and posted.

Email always ends up in spam

There are a wide variety of things this could be, so any answers to this question would be speculation. Keep in mind, it’s the email that gets marked as spam (and the details of the sender, domain, etc), not the code that generates the email. That being said, I would investigate the sender information first … Read more

New user notification issue

In your email code you’re using mail PHP function, whereas WordPress uses its own internal wp_mail function that then sends the email using PhpMailer (for many different reasons) .. which should be using PHP’s mail fn but there’s a number of different things that could be causing problems. You can also install the “WP Mail … Read more

Cron not sending wp-mail()

You can test if mail has been sent or not using the following: // Set $to as the email you want to send the test to. $to = “[email protected]”; // Email subject and body text. $subject=”wp_mail function test”; $message=”This is a test of the wp_mail function: wp_mail is working.woo!”; $headers=””; // Load WP components, no … Read more

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