PHP displaying html email in a html page

前端 未结 4 660
误落风尘
误落风尘 2021-01-12 11:26

I\'m building an PHP email mailbox script.

How would I make html emails display cleanly as they do in gmail/hotmail.

If I just echo it out it affects the who

4条回答
  •  猫巷女王i
    2021-01-12 12:06

    Create a DIV container that you assign width (and height if needed) to, and make sure you add an overflow property to match your design. This should keep your email HTML from interfering with your layout.

    UPDATE

    A DIV container still assures you that you can constrain the size of the display box and with appropriate CSS acts similar to an iframe without all the baggage.

    If you are worried about the code in the email, strip_tags would seem a better solution than the regex. You can define a list of tags to leave alone and still be confident of stripping the rest.

提交回复
热议问题