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 to make sure the headers in the email are set to show the email is sent via a valid email address with the a domain that matches the sender’s domain or is authorized to send on behalf of the domain.
You can try a testing service like MXToolbox to ensure email is being delivered successfully.
Related Posts:
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- WordPress “phpmailer_init” not working for me
- How do I override the Message-ID header of wp_mail function?
- WordPress new user / forgot password emails are broken
- wp_mail function timing out
- Why is my get_post_meta always empty
- Should I use wp_mail or PHP’s mail? [duplicate]
- Mail not sent when I set HTML headers
- Error when requesting password reset email – wp authentication
- Processing a subscription form with POST method?
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- wp_mail not sending
- Validate emails in array using foreach
- Redirect to another page after submission using wp_mail
- PHP 8, AJAX mail form to function.php doesn’t work
- How to retrieve the sender email with wp_mail()?
- wp_mail file attachment not being placed in upload folder?
- Website needs to be opened for wp_mail to work
- Notify users only on post publish
- Sending a custom form data in email through WP Mail Function
- Pass Variables or Variable Place-Holder from Editor to PHP
- Pass return-path additional parameter in wp_mail
- Send notification email to admin for every new post published
- Different SMTP based on domain
- Get page permalink in contact form
- comment_post (if comment is approved OR $comment_approved === 1) not working?
- Running SMTP Conditionally
- Including user data in “new user notification email”
- Cron not sending wp-mail()
- Premature end of script headers: wp-mail.php?
- Adding action item to admin users table and sending email
- Wp_mail doesnt work
- get_post_meta is always empty when I use wp_mail
- How to show value from ACF plugin field in e-mail?
- wp_mail vs mail functions and header arrays
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- wp_mail – send emails after 24 hours from users registration
- Send emails to individual subscribers when CPT post is deleted (trashed)
- Send registration email to all admins
- What exactly does “Posts page” do in WordPress?
- How do I make my function add variables/values to the $post object?
- Change comments form title on a page by page basis
- “Can’t use function return value in write context” error
- Displaying Only Certain Tags in Loop
- Customized title tag for each page in pagination?
- ACF: Only get first row of a Repeater Field
- WordPress with php 5.5 and zend opcache
- Woocommerce add to cart quantity buttons with AJAX
- How can I use wp_query to show all product data using just the products ID?
- WP add_action factory
- save imported posts as drafts
- How to show phpinfo() only in a new tab?
- Ajax load more posts with multiple tax query
- Ajax call not working
- Are there security or other issues with changing PHP time limit and max input vars?
- How can I pass a custom/dynamic product to the Woocommerce cart?
- Long running queries
- comments sorting incorrectly across multiple pages
- Irregular TTFB and server wait time response
- How to access variables from Functions file in theme files
- How can I modify footer when footer.php calls to another file?
- retrieve post data and insert it in seperate static html page without WordPress
- PHP conditional script issue
- Find Site ID From WP_Post
- change the default order of posts only for specific categories
- Array to string conversion error in PHP 7.2 when returning user role as class
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- How can I get “Previous” and “Next” to show in the navigation besides the links?
- Splitting the_content() by size?
- with PHP within splits the link
- WordPress And High disk i/o
- Saving a post ID to use in a form elsewhere on website
- random reason on refresh
- WordPress Fresh Install Errors (Woocommerce specifically now)
- Create shortcode for metabox gallery
- how do i add custom widget woocommerce shop page with php
- code that I can run, or a plug in to show what sql tables something pulls information from
- Display attached images of a page or post that are insetred using gallery
- overwrite wordpress gallery with custom gallery shortcode
- Upgrade to PHP7.3 and Changing Apache from Prefork to Event Breaks WordPress
- How can I copy an ACF field to AIOSEO field? [closed]
- How to find php variable of wordpress theme settings
- Date of last blog update for specific authors only?
- I was wondering if it’s possible to implement card.js on WordPress
- Ajax call URL 404’ing when pushed to staging server
- Modify arguments for parent theme’s `wp_register_style` via child theme
- WordPress Rewrite Issue
- Replace content in WordPress Page after GET from php page
- How to Publish WP original Source metabox value on front-end webpage
- How to wrap a text with shortcode into php file?
- error with WP custom form
- changed front-page template gives 500 error
- PHP Syntax getting PHP terms
- WP Custom tables query
- Deprecated: Return type of WC_Appointments_Availability::offsetExists($offset) [closed]
- Why plugins can’t add(inject) their code in my comments?
- How rename wp-content and wp-admin folders correctly
- Pre_get_comments and orderby comment_karma
- External WP_Query call from PHP crashed after version update
- WordPress post-template null warnings