问题
Possible Duplicate:
Email client detection
I have a newsletter which will have a link to my websites pages. Now i want to know which email client (gmail, hotmail, outlook) the user opened the newsletter in and clicked the link to the website page.
The reason I want to know which email client, is because i want to customize the content in website pages based on the use of email client by users.
My Website pages will be coded in PHP
回答1:
Look at the User-Agent header ($_SERVER['HTTP_USER_AGENT']).
For users using webmails, the user-agent will be that of their browser; so you could look at the Referer header ($_SERVER['HTTP_REFERER']) too. (But notice that browsers don't send referer headers from https sites.)
来源:https://stackoverflow.com/questions/7422754/how-to-know-from-which-email-client-the-http-request-was-coming-from