Taking custom actions on email received

Discussion in 'Email' started by jzahoor, Jul 28, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. My email is hosted with DASP.

    I'd like to be able to receive emails and based on the email address it was sent to, perform custom actions, e.g., create a record of that email on a specific RecordId. Ideally, I would like to do this all using an app/website sitting on DASP servers and not have to deal with a client-based installation on my server or local machine.

    Example:
    - mydomain.com is hosted by DASP
    - Someone sends an email to [email protected]
    - I want this email to be parsed such that the subject and body of the email is stored as a new record linked to original record 1234.

    Has anyone done this? Is it even possible to do this via DASP-hosted email?

    Thanks,

    - JZ
     
  2. This will be possible for sure; you're just going to need to develop a web application that is a pop3 / imap4 email client. Your application will also decide whether you want the original mail to remain on the mail server or be processed and removed.
     
  3. Thanks Joe,

    How would I be able to listen to the mail server to pick up my mail? Any code snippets for ASP.Net would be most helpful, if you've done something like this before.

    Would DASP allow me to peek into the mail server using my custom code, considering they host the mail?
     
  4. Due to the fact a web application is a stateless entity and not really a continually running process like a traditional email client application is that runs on the desktop, you're going to need to implement a slightly different approach. Here is one method that will work on DASP:

    1) Create a new aspx web page that will act as the email client. This page will contain the code to connect to the email server using either the POP3 or IMAP4 protocol and will perform the task of retrieving emails and logging them to the database.
    2) Setup the DASP scheduler to regularly request this new page which will in turn will execute the email retrieval / db logging process.

    When you say 'peek' at the email, it sounds as though you want mail to be left on the server by this process. If that's the case, perhaps you want to use IMAP rather than POP3. Another alternative might be to configure Smartmail forwarding to copy emails to some other mailbox in the account.

    Sample code? Unfortunately there is no POP3 or IMAP support built into the .NET framework but the good news is that DASP do give all customers the ability to use the /n software IP*Works suite for free on both IIS6 and 7 and this toolset includes good support for both of these protocols. These components should already be installed on the DASP web server so you'll need to download the trial version from http://www.nsoftware.com/ipworks/default.aspx to get started with local development. The trial also includes sample code for POP and IMAP so I think that should be everything you need.
     
  5. Thanks again Joe. This helps a lot. I've also looked at ASPNetPop3 and that too is DASP supported and should be sufficient for what I need.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page