Standard way to detect mobile mail client?

前端 未结 4 1516
旧巷少年郎
旧巷少年郎 2021-02-01 23:17

This question is similar to \"Standard way to detect mobile browsers in a web application based on the http request\" except for mail clients. For instance, if an email message

4条回答
  •  情书的邮戳
    2021-02-01 23:52

    You can try to apply @media css queries that target specific browsers like mobile devices. There is a good introduction on the campaignmonitor help website but be aware, it probably is only supported in a hand full of browsers and devices, iOS being on of them luckily :)

    Basically you are defining css styles that target specific screen widths so that you can optimize your email for limited screen space.

    @media only screen and (max-device-width: 480px) { ... }
    

    When talking really detection and displaying a totally different email, that's really impossible since you are talking about javascript there and that's not done in emails and probably won't even work in 99% of all email clients. But you can go a loooong way with @media queries.

提交回复
热议问题