mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #388] Error : importing external CSS styles #253
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#253
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @maximovj on GitHub (Nov 16, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/388
Error : importing external CSS styles
I am working with HTML and Bootstrap v5 to send an email and display Bootstrap v5 CSS styles, but
mailpitcannot load the Bootstrap styles correctly. The same issue occurs with emails sent from Laravel.In the HTML Source tab, I can see the code in more detail, but in the HTML tab, the Bootstrap 5 styles are not applied correctly. I have tried adding the --block-remote-css-and-fonts flag as per the official documentation to fix the issue, but the problem persists.
This is the tab: HTML Source

This is the tab: HTML Source

This is the expected result:

@axllent commented on GitHub (Nov 16, 2024):
It should be working as-is because remote CSS is not blocked by default. Can you please attach a sample message (which I can feed into my Mailpit) to test? Thanks.
@maximovj commented on GitHub (Nov 16, 2024):
This is a test message I am making.
message-test.txt
I noticed that this error appears in the browser console, it could be the issue.

I am currently using Laravel 8.x and PHP 7.4.33 from Laragon, as shown in the image.

I did one last test, now in MailHog, and it works correctly when viewing the HTML.

@axllent commented on GitHub (Nov 17, 2024):
Bug confirmed - leave this with me!
@axllent commented on GitHub (Nov 17, 2024):
Thanks for reporting this bug - it's actually been broken for several months so I'm surprised nobody reported it earlier! The fix has been fixed in v1.21.4. Please let me know if it is working again for you? Thanks.
@maximovj commented on GitHub (Nov 17, 2024):
I ran two tests using version
v1.21.4, and the issue was successfully resolved.Cool, bro, it works.
This is test number one

This is test number two

@axllent commented on GitHub (Nov 17, 2024):
Perfect, thanks for testing and the quick confirmation!
Regarding using external stylesheets (in general), please note that external CSS files is not the recommended approach as popular web clients like Gmail do not support it. And of those that do, most do not support modern CSS like bootstrap (so some features may not work). If you're going to be using it, then keep in mind that there will be a significant portion of users who will not have any styling applied.
I'll close this issue now. Thanks again for reporting it!