Exclude Current user email and send notification

First, you should know that current_user_can() only accepts capabilities, not roles, so you are using it wrong and you can end up with unexpected results. That being said, to exlude users form WP_User_Query you can use the exclude parameter: // Get current user data $user = wp_get_current_user(); // Check if current user is a subscriber … Read more

Trying send mail from Theme page

If you assign wp_mail() to a variable you can echo the results. Should return either true or false. $email = wp_mail(email,subject,message); var_dump($email); I don’t recognise the send_message() function in your code.

Contact forms not sending mails

For SMTP and Gmail, you will need turn on 2 step verification, then create an App specific password in security panel of google account. Use your email and that password as login credential. You’ll also need use TSL or SSL for SMTP. Hope this help!

Send e-mail from admin area to adresses in custom field

First, decide whether you want to use GET or POST for your form. (without specifying the method, it will use GET.) You will need the name attribute filled out for your textarea, so the info can actually be sent. Then add your form processing into your function: (i.e. if ( isset($_POST[“message”]) && !empty($_POST[“message”]) ) {…} … Read more

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