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
- Disable comments on all posts/pages
- Stop WordPress redirecting comment-page-1 to the post page?
- Would switching to InnoDB from MyISAM improve performance of comments table?
- Linking to Page Showing Only Comments Without Parent Post
- Post Comments using WP REST API v2 in WordPress
- Using filter to add additional fields to comment_form()
- Disable wordpress comments API
- Comments waiting but no comments found
- Programmatically block commenting by restricting view of comment form
- Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins
- Plugin from WordPress.com for comment notification…available? [closed]
- How to add text to comment form #content textarea?
- Passing arguments to wp_list_comments callback function
- What are the additional fields in wp_comments used for?
- comments_template not working correcly in custom template files
- Why are my comments closed?
- How to change style of Disqus comment count on main page
- Filter custom comment type from Manage Comments & Dash Widgets
- Suddenly all emails in User have [email protected]
- How to allow more HTML tags in comment for a certain comment_type
- How to deal with spam comments and distinguish them from non-spam comments?
- User’s total comment count excluding comments on their own posts
- How to allow logged in users to post anonymously
- How to get all comment authors of a single post?
- comment_reply_link not work with me
- How can the recipients and content for comment email notifications on a custom post type be changed?
- have_comments() does not work
- How to allow duplicate comments AND without comment text
- How do I automatically insert some text in the comment textbox on submit?
- I cannot view the comments
- Hide comments and posts posted by other user
- In wp_list_comments comment dates won’t work?
- how to SELECT for the current post id?
- Custom comment link
- How to display the user’s comment status on the front end
- How do I make Twenty Ten display comments on the home page?
- Allowing WordPress.org/com accounts on a self-hosted install
- How to remove the “comments” bit that appears next to or below the posts
- WP Create User – Preventing repeated information
- Sort post comments from newest to oldest in pagination
- Using Disqus with headless WordPress setup?
- Pre- Approved Comment Capability
- Delete comments function
- Comment form not working
- How to show a “Comments Are Closed” message on posts where comments have been closed?
- Comments pagination on author page
- Comments page id wp_list_comments
- Required Field for Comment parent only?
- Can I use WP comments for custom tables?
- How can I have a full comments.php for an easy editing of all its aspects?
- writing a plugin, how to disable the comment form altogether?
- Function to get a list of all comments on 1 post [closed]
- Auto delete WordPress comments
- How to disable comments on new blog post, but allow on new products?
- Show/Hide comments