Tech Off Thread

12 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

.NET to Receive Email

Back to Forum: Tech Off
  • User profile image
    W3bbo

    We all know how simple it is to send email with .NET, System.Web.Mail (System.Net.Mail in DotNet2.)

    ....but what can you do so that a .NET application can receive email?

    Yes, I know you can write a program or service in .NET that polls a mailbox, but that isn't very efficient.

    I was thinking more along the lines of a program that receives SMTP messages and handles them appropriatey.

    ...is it hard to author SMTP servers in .NET thesedays?

  • User profile image
    IceFreak2000
  • User profile image
    Tom Servo

    The SMTP protocol is ASCII based and fairly simple.

  • User profile image
    Maurits

    Tom Servo wrote:
    The SMTP protocol is ASCII based and fairly simple.


    Unfortunately it's useless for receiving email.  To receive you need either MAPI or IMAP or POP3 or DAV or something.

    EDIT: Oh, never mind.  If you're the SMTP server of course you can receive email.

  • User profile image
    W3bbo

    How would one implement a system where a user sends an email to an SMTP address and an ASP.NET application picks it up and processes it.

    Consider those "helpdesk" softwares available, where you can reply to emails which are then parsed and put into the database.

  • User profile image
    Maurits

    W3bbo wrote:
    How would one implement a system where a user sends an email to an SMTP address and an ASP.NET application picks it up and processes it.

    Consider those "helpdesk" softwares available, where you can reply to emails which are then parsed and put into the database.


    Well, if it was me, I'd put an MSA in the middle.  I've had to deal with direct-SMTP solutions and reliability becomes a concern.

    This leads to the question of what to use for your MSA... Exchange may be a bit heavyweight of a solution.

    But anyway, once you have a mailbox set up, it's a simple matter to set up a .NET application that checks it more or less continuously and processes the mail items.  I don't think ASP.NET is appropriate here, some kind of daemonservice is called for.

  • User profile image
    Maurits

    Maurits wrote:
    once you have a mailbox set up, it's a simple matter to set up a .NET application that checks it


    Hmmm, maybe not.  I don't see any native .NET methods for MAPI, POP3, or IMAP.

  • User profile image
    JChung2006

    Writing .NET code that understands and issues POP3/IMAP/SMTP commands is not difficult.

    Writing a .NET service to provide robust, secure, scaleable e-mail services, on the other hand...

  • User profile image
    mjnagpal

    is you are using SQL Server - how about SQL Mail?

  • User profile image
    PerfectPhase

    Depends what you want to do, but for something like a help desk app how about using the built in SMTP service?  Just set it to dump all emails to a drop directory and use the filewatcher component to pick up the eml files and do something with them?



    Stephen.

  • User profile image
    W3bbo

    PerfectPhase wrote:
    Depends what you want to do, but for something like a help desk app how about using the built in SMTP service?  Just set it to dump all emails to a drop directory and use the filewatcher component to pick up the eml files and do something with them?


    I'm just speaking hypothetically here. I'm not actually producing something that requires this feature, but if I ever did... then I know where to look.

    To my knowledge, Linux-based products, like cPanel and the like allow the forwarding of emails directly to a PHP script. I wonder how that works.

  • User profile image
    Maurits

    W3bbo wrote:
    I'm just speaking hypothetically here. I'm not actually producing something that requires this feature, but if I ever did... then I know where to look.

    To my knowledge, Linux-based products, like cPanel and the like allow the forwarding of emails directly to a PHP script. I wonder how that works.


    In the situation where I had to deal with automatically scripted handling of mail, the forwarding agent was procmail

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.