Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Images in wp_mail not showing

Ok, so I switched the image root path from

define('SUBSCRIBE_USER_BASE_DIR', dirname(__FILE__));

to

define('SUBSCRIBE_USER_BASE_URL',plugin_dir_url(__FILE__)); and this worked.

dirname(__FILE__) registers:

<img src="https://wordpress.stackexchange.com/var/www/html/internal/wp-content/plugins/AV_-_Subscribe_User/email/email_header.png"

Whereas the latter plugin_dir_url(__FILE__) outputs:

<img src="http://mysite.com/wp-content/plugins/AV_-_Subscribe_User/email/email_header.png"

I’m not 100% clear as to when to use which but I’m guessing that I would use dirname when I am operating within the site server.

Related Posts:

  1. Include HTML template file in wp_mail
  2. WP mail sent to MS Exchange recipients = occasional email corruption?
  3. Send and receive emails with wp_mail() for WP User (like Mailserver)
  4. Is there a way to embed an iframe in an email with text that updates?
  5. Sending multipart (text/html) emails via wp_mail() will likely get your domain banned
  6. How to set SMTP programmatically
  7. Do something after sending email
  8. Mail will not send in HTML
  9. Create custom welcome email without a plugin
  10. Email sent from WordPress has HTML tags
  11. Reset Password – change from name and email address
  12. Few chars getting replaced with ‘=’ in mail content in wp_mail()
  13. wp_mail recipient array not sending?
  14. On form submission how to send 2 email to different users
  15. How to Configure SMTP on wordpress Cant Send Email
  16. How to add line breaks to $email[‘body’] when using auto_core_update_email hook
  17. Joining confirmation email
  18. How to setup SMTP for only one specific wp_mail()
  19. Must I change the admin user email address while changing the general email address?
  20. User invite email not delivered – related to subdomain?
  21. Can I configure WordPress to use postfix without a plugin?
  22. Email ‘from address’ has a www in it
  23. Trigger WordPress Actions from Email?
  24. PHP mail() works but wp_mail() does not
  25. WordPress unable to send mail
  26. Not able to send links in email after setting header
  27. Emailing passwords: Setup installed on home server using XAMPP
  28. Mail function is not working
  29. Send bulk emails without timeout
  30. What is the best way to send out thousands of emails from a WordPress site? [closed]
  31. Change the Sender(not From) on wp_mail() function [closed]
  32. Prevent sending emails on user creation in OOP context?
  33. HTML email sent with wp_mail shows plain text
  34. WordPress email could not be sent
  35. Getting image in mail
  36. Send email daily using `wp_mail`
  37. wp_mail() won’t send mail when it’s a variable, only when hard coded
  38. Send email for confirmation during user registration
  39. About Custom Email Template Design Responsive
  40. WordPress new user email formatting issues
  41. Email sent from WordPress has HTML tags
  42. wp_mail send multiple emails in a loop
  43. Can’t change headers / From for wp_mail()
  44. How can I remove the product short description from the WooCommerce Mails?
  45. New user notification issue
  46. Why do WordPress emails to multiple recipients include \n in the list
  47. wp_mail() not sending emails with ajax
  48. wordpress wp mail not changing sender mail
  49. Whitelist email sent by WordPress
  50. WP Mail isn’t sending user account messages, does send from plugins
  51. Asynchronous emailing
  52. Send email from WordPress
  53. Not able to override pluggable function with a mu_plugin
  54. What is the correct way to send multipart email in wordpress?
  55. Filter “wp_mail” – How to distinguish between a WordPress system email and a plugin email?
  56. SMTP connect() failed PHPmailer – PHP
  57. What is the difference between ports 465 and 587?
  58. Email validation in Ruby on Rails?
  59. Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
  60. Why won’t wp_mail() let me set the From: header when plain old PHP mail() will?
  61. changing notification emails from WordPress @mydomain.net to something else
  62. Disable user registration password email
  63. WordPress refuses to send mail, “…your host may have disabled the mail() function”
  64. Alert Email when any Post or Page is Changed
  65. How do I customise the new user welcome email
  66. How do you update user_email on the front end in WP 3.3?
  67. Missing URL in password reset email
  68. User Without Email?
  69. How to add headers to outgoing email?
  70. “Reply-to Address” Email
  71. prevent users from changing their email address
  72. wp_mail and BCC headers
  73. how to set from address according to the form input email address for wp_mail()?
  74. Disable new user notification to admin email
  75. Using WordPress templating for HTML emails
  76. Allow Duplicate Email Address for Different Users
  77. How do I override the Message-ID header of wp_mail function?
  78. Email confirmation on registration
  79. wp_mail script with jQuery post
  80. Customizing lost password email
  81. wp_mail – Remove sitename from email subject
  82. How to disable automated E-Mail on PHP error/exception?
  83. How do i send mail with custom Form Data using WordPress
  84. Email as Username in registration
  85. Email stats at Ma.tt contact form
  86. Fwd: [Website Name] Notice of Email Change [closed]
  87. Send all WPMU emails via SMTP
  88. Send mail to wordpress admin
  89. Send a confirmation of user role upgrade conditionally
  90. WP Cron emails not working
  91. Dynamically send pdf attached to post with contact form 7 [closed]
  92. Locked out of my own blog and password reset not working
  93. Change Password notification text on mail
  94. wp_mail not recognizing cc and bcc headers
  95. Transferring contact form input to an email account without using an email-proxy
  96. Should I use the standard wp_mail() function for a premium theme?
  97. Send batch of posts as HTML Email?
  98. email wordpress users using BCC
  99. Contact Form 7 + Configure SMTP: Sender email appearing as my own email [closed]
  100. email sends from [email protected] even though I have it set to something else
Categories email Tags email, html-email, wp-mail
Output Buffer Issue with Single Post View
get_pages Not accepting my query

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress