Hello daniweb,

I'd like to know if it's possible for a newsletter to check which email client is rendering the content and based on which one it is, it would create a link for the best possible viewing solution.

For instance, if someone has Outlook 2003, I want to create a link here:

If someone is using Outlook 2007, I want to create a link here:

Would something like that be possible?

Thanks!

Dani AI

Generated

For : short answer — you cannot reliably run code inside most email clients to switch links on the fly. was right to think about sending info to a server, but JavaScript in email is effectively unusable and server-side detection has important limits.

Practical options that work today:

  • Use Outlook conditional comments to show Outlook-only HTML (desktop Outlook will render that block; most other clients ignore it). Example pattern:

    <!--[if mso]>
      <a href="https://example.com/outlook">Open optimized for Outlook</a>
    <![endif]-->
    <!--[if !mso]><!-- -->
      <a href="https://example.com/default">Open optimized for other clients</a>
    <!--<![endif]-->

    This lets you present an Outlook-specific link inside the email itself.

  • Use a redirect/landing page you control. Point all newsletter links at a tracking/redirect URL (one per recipient or per campaign). When clicked, the server inspects the incoming HTTP request and either redirects to a version optimized for that browser or shows a chooser. Important: that detects the browser that opened the link (the web browser), not necessarily the mail reader that rendered the email. Also many webmail providers proxy image requests and hide the original client, so open-tracking and image-based detection are unreliable.

  • Best practice: design resilient emails and provide a “View in browser” fallback at the top. Let the landing page do full detection (and run JS there) so you can reliably serve versioned HTML or ask the user which layout they prefer.

Caveats: image blocking, proxying (Gmail/Outlook.com), and mobile apps all reduce the accuracy of client detection. Use conditional comments for Outlook desktop and server redirects for click-time routing, but rely mainly on robust, responsive email markup and a browser-based landing page for any complex client-specific experience.

Member Avatar for Member #733618

i think that this is with javascript... you can read something of him. or when the mail is open, send something to the server and the server know that it was open...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.