When creating HTML emails, should we use html, head, body tags?

后端 未结 6 597
轻奢々
轻奢々 2021-01-31 06:57

In my email views, I usually just do something like...

Name
Value

Should

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 07:14

    The right way is to follow the HTML standard. You can validate your HTML page here.

    Your mail client should follow it and should throw away what's not supported or what's insecure like javascript.

    UPDATE: after several down votes from people that gets angry when you tell them to follow standards, I'll expose some reasons of why following standards could be beneficial here:

    1. a webmail willing to show your mail as a full page, could keep your format.
    2. a webmail will simply strip the tags and attributes it doesn't want. But you can't never know which ones.
    3. It's easier to find (server side) components that follow format standards, and thus less error prone. Parsers not following standards could possibly break, making your email not getting shown.

提交回复
热议问题