0

This is most probably duplicated but I can't seem to find a previous question like this.

How would you go about creating a unique email address for each user in your web app just like sites like evernote and trello, where the user can email it and it posts to that users account?

(I am only interested in creating the emails, not the actual matching the emailed content to the user)

Thank you in advance

ashcharlton
  • 143
  • 1
  • 9

1 Answers1

1

There are a couple ways you could accomplish this.

  1. You could program your own SMTP server in C# and when email comes in decide to take whatever action you deem relevant (add records to your DB, etc). http://www.codeproject.com/Articles/3991/SMTP-and-POP3-Mail-Server

  2. Use an existing SMTP server (e.g. gmail for domains, outlook365, etc), and create a catch all email address so regardless of the first half of the email, they all get delivered to a single email address. THEN, access the mailbox with POP3, examine who the email was sent to (user1234@somedomain.com, not catchall@somedomain.com) and perform whatever action you want (add records to your DB, etc). see: Reading Email using Pop3 in C#

Personally, I would go with the later option, there are fewer moving pieces that you'd be responsible for. You don't want to try to program your own SMTP server, gmail, exchange, etc have already done that for you. You just need to get access to it. The key is setting up the catch all email address so you don't need to programatically set up different inboxes.

Community
  • 1
  • 1
viggity
  • 15,039
  • 7
  • 88
  • 96
  • 1
    Not really what I had in mind at first but then thinking about it and seeing another example online I realised this is actually a great solution. Thank you. – ashcharlton Aug 27 '15 at 15:11