Send a confirmation of user role upgrade conditionally

Quite possibly something like this might work; function user_role_update( $user_id, $new_role ) { $site_url = get_bloginfo(‘wpurl’); $user_info = get_userdata( $user_id ); if (user_can( $user_id, ‘capability’ ) ) { $to = $user_info->user_email; $subject = “Role changed: “.$site_url.””; $message = “Hello ” .$user_info->display_name . ” your role has changed on “.$site_url.”, congratulations you are now an ” … Read more

Send mail to wordpress admin

I could not really work out with the ajax with plugins things. Not so good with it still. 🙁 So i simply used the function get_bloginfo(‘admin_email’) to obtain the admin’s email address. Using mail() function, the mails are sent to the obtained email address on click of the button.

Send all WPMU emails via SMTP

If I understand the question correctly, you’re having trouble with SMTP settings in a Multisite environment; specifically, your SMTP settings are not propagating throughout your sites from the root site. It’s possible that you need to configure the SMTP settings for every site individually, even if you’ve network activated the plugin. Some plugins aren’t written … Read more

Fwd: [Website Name] Notice of Email Change [closed]

This is a feature since 4.3.0, as part of WordPress’s improved security measures (check out the source on the WordPress code reference). You can disable it with the following filter: add_filter( ‘send_email_change_email’, ‘__return_false’ );

Email stats at Ma.tt contact form

This is actually not all that hard to do using the imap functions in PHP: http://php.net/manual/en/book.imap.php Basically, he has some script somewhere which runs every hour or so. I have not seen this script, but I can venture a good guess about how it works. First, it connects to his email system, probably using imap. … Read more

Email as Username in registration

You can use @ and . in usernames, so there is no problem. Now you could create your own register form and use register_new_user(). You could even manipulate wp_registration_url() with the filter register_url, so the register link would point to your new register page. If you want to use it with the standard interface provided … Read more

How do i send mail with custom Form Data using WordPress

wp_mail is the function you are looking for. You can take the posted form data ($_POST[’email’], for example) and then use it to build and execute the wp_mail function. The example below was taken from https://developer.wordpress.org/reference/functions/wp_mail/#user-contributed-notes $to = $_POST[’email’]; //[email protected] $subject=”The subject”; $body = ‘The email body content’; $headers = array(‘Content-Type: text/html; charset=UTF-8’); wp_mail( $to, … Read more

Reset Password – change from name and email address

You can use the following two hooks to change name and email address Use the following in your active theme’s functions.php file. add_filter( ‘wp_mail_from’, ‘wpse_new_mail_from’ ); function wpse_new_mail_from( $old ) { return ‘your email address’; // Edit it with your email address } add_filter(‘wp_mail_from_name’, ‘wpse_new_mail_from_name’); function wpse_new_mail_from_name( $old ) { return ‘your name or your … Read more

How to disable automated E-Mail on PHP error/exception?

There was some discussion on it a few weeks ago you can find here: https://make.wordpress.org/core/2019/04/16/fatal-error-recovery-mode-in-5-2/ According to that and looking through the core, you can accomplish that with one of two methods: define(‘RECOVERY_MODE_EMAIL’, ‘[email protected]’); OR add_filter( ‘recovery_mode_email’, ‘recovery_email_update’, 10, 2 ); function recovery_email_update( $email, $url ) { $email[‘to’] = ‘[email protected]’; return $email; } Hope that … Read more

Email sent from WordPress has HTML tags

The default content type is ‘text/plain’ which does not allow using HTML. You can set the content type of the email by including a header like “Content-type: text/html” $headers=”Content-type: text/html;charset=utf-8″ . “\r\n”; $headers .= ‘From: XXXXXX.com <[email protected]>’ . “\r\n”; $subject=”Registration from xxxxx.com” . “\r\n”; $message = $result_email_text; wp_mail($_POST[‘admin_email’], $subject, $message, $headers ); Or you can … Read more

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