global $wpdb, $post;
$query = sprintf("SELECT comment_author_email
FROM {$wpdb->comments}
JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID
WHERE comment_post_ID = %d
AND comment_approved = '1'",
$post->ID);
$emails = $wpdb->get_col($query);
$emails = array_unique($emails);
// your e-mails
print_r($emails);
You can also use the built-in WP_Comment_Query
(or get_comments), but it’s going to be a little slower…
Related Posts:
- WordPress comments email notification for authors
- Commenting in user profile page?
- How to change the email notification recipient (user) for new comments?
- Show content only if member left a comment
- Post comment as different user than logged in
- Get most active users sort by comment count
- If new comment posted in custom post – send notification to custom email from custom field
- Disable Admin account being emailed for comment notification
- Send Notifications to All Admins
- List User Comments on User Profile BuddyPress [closed]
- Hold comments for moderation only if user is not logged in
- Display WordPress commenter nice name
- Reject Comments Based on Author Email
- Check if someone recently commented in one of my posts
- Highlighting the current users comment
- Display the number of unseen comments on a page since the user last visit
- Same email for all comments
- Error While Sending Comment
- Reply By Email to comment notifications
- Allow the comment author to delete their own comments
- All users/comments suspected as bot? [closed]
- comment reply by email
- Commenting in user profile page?
- if user role is then echo text
- Remove the deleted user comment
- Anonymize comments after one year
- Best way to tell if a comment is from a user?
- How do I disable the discussion notification emails to us when a comment is “approved” and when an adiministrator replies?
- Sent comments notifications to multiple users
- How to get Post title by locale with Qtranslate-X
- Custom comment field not showing when logged-in
- get_comment_author_link not working properly
- How to use filter on comment submission/insert
- Problem in getting user comments permalinks
- How to prevent users/authors from seing IP/email of new commentators?
- wp list all users who haven’t commented on a post
- I want to limit registered user to 1 comment per post in WordPress
- Let user delete comment on front end only
- Not receiving any e-mails after new comment
- Comment notification not working
- selectively disable akismet
- How to display comments by logged in user and responses?
- Deleting users do not deletes coments
- delete user not working
- Subscribe to a post’s comments without posting a comment yourself
- How do I comment out a block of tags in XML?
- R: Comment out block of code
- How to change the default registration email ? (plugin and/or non-plugin)
- Why do I get comment spam even with Akismet and Captcha?
- What tools are available for managing/writing to WordPress? [closed]
- How to rearrange fields in comment_form()
- setting comments off as default for pages and custom post types?
- Is it possible to pull comments from facebook into your blog?
- get_user_meta() doesn’t include user email?
- Confirmation required on email change
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Non-threaded comment replies with link to original comment
- Approve comment hook?
- How to change “You must be logged in to post a comment.”
- comment_post_ID 0 (cannot remove from dashboard)
- Disable comments on all posts/pages
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- Stop WordPress redirecting comment-page-1 to the post page?
- Importing old Disqus comments into WordPress
- How to add a class to the comment submit button?
- How to wrap submit button of comment form with div
- Email user when password is reset by admin
- How to enable comments for pending and draft posts?
- Using WordPress’ WYSIWYG for comments
- Enable Submit Comment Without Page Reload (Using Ajax)?
- What for is the table “wp_commentmeta” exactly?
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- Add option to disable comments on a per posts basis?
- Resetting comment count
- When importing – failed to import: Invalid post type feedback
- How to limit users to one comment per post
- Redirect user to a custom url after submitting the comment
- Paginate result set from $wpdb->get_results()
- Change Comment Author Display Name
- Would switching to InnoDB from MyISAM improve performance of comments table?
- Custom comment type based on thread level
- How to add internal, revision comments to page updates
- How to load and show comments with AJAX instead of pagination?
- Linking to Page Showing Only Comments Without Parent Post
- How to set up User email verification after Signup?
- Comment Reply javascript
- How do we remove the H3 tag for the reply-title I.D
- Comments not appearing at all
- comments reply script not working
- How to display comment form error messages in the same page
- 3 moderators to approve comment
- How to deal with small scale comment spam on small commercial sites? [closed]
- What should I do to make generated avatars different for anonymous comments?
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- Check If comment author is registered
- Comments screen in backend, how to disable email address of commenter for non admins
- Add comments from the admin panel?
- How can I limit the number of comments per registered user per day?
- One comment per user per post but be able to reply to existing comments