Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to detect user email address when user clicks on a link sent to their email?

How to detect user email address when user clicks on a link sent to their email?

Scheduled Pinned Locked Moved C#
csharpcomtutorialquestion
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zeyad Jalil
    wrote on last edited by
    #1

    Hi, I want to detect the user email address when the user clicks on a link sent to their email, the following: 1. From my c# windows application I send an email to (a@y.com,b@y.com) and in the cc (c@y.com). 2. when the user open his email and click an a link inside the email body, this link will open a web page, I want to know the user who clicked the link. is (a@y.com or b@y.com or c@y.com). Please let me know if it is possible an how to do that Thank You

    D OriginalGriffO Richard DeemingR 3 Replies Last reply
    0
    • Z Zeyad Jalil

      Hi, I want to detect the user email address when the user clicks on a link sent to their email, the following: 1. From my c# windows application I send an email to (a@y.com,b@y.com) and in the cc (c@y.com). 2. when the user open his email and click an a link inside the email body, this link will open a web page, I want to know the user who clicked the link. is (a@y.com or b@y.com or c@y.com). Please let me know if it is possible an how to do that Thank You

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The only option you have is to include the users email address in your link. The site would have to parse out the email address from the URL parameters.

      Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
      Dave Kreskowiak

      1 Reply Last reply
      0
      • Z Zeyad Jalil

        Hi, I want to detect the user email address when the user clicks on a link sent to their email, the following: 1. From my c# windows application I send an email to (a@y.com,b@y.com) and in the cc (c@y.com). 2. when the user open his email and click an a link inside the email body, this link will open a web page, I want to know the user who clicked the link. is (a@y.com or b@y.com or c@y.com). Please let me know if it is possible an how to do that Thank You

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        Dave suggests one way, but another is to add a query code to the link. Make it unreadable - a Guid is fine - and use that value to lookup in your "sent emails" database which user email address it was sent to. This way, you don't expose any sensitive info, and it's not possible (or at least feasible in a reasonable timeframe) to give a fake email and then confirm it without the actual email sent by you. It's also simple to "expire" confirmations. What you end up with is a URL that is readable, copy'n'pasteable, or clickable, but preety much impossible to guess:

        mydomain.com/register.aspx?ec=50660b24af1f4056afc292ed3f9cece1

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        1 Reply Last reply
        0
        • Z Zeyad Jalil

          Hi, I want to detect the user email address when the user clicks on a link sent to their email, the following: 1. From my c# windows application I send an email to (a@y.com,b@y.com) and in the cc (c@y.com). 2. when the user open his email and click an a link inside the email body, this link will open a web page, I want to know the user who clicked the link. is (a@y.com or b@y.com or c@y.com). Please let me know if it is possible an how to do that Thank You

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          As the other answers have pointed out, you need to include something in the link to identify the address you sent it to. What might not be obvious is that this means you cannot send the same link to multiple addresses and expect to identify which one clicked the link. That means you need to send different messages to a@y.com, b@y.com, and c@y.com. If there are multiple addresses in the "To" field, or you're using both "To" and "Cc", you cannot determine which recipient clicked the link.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups