Emailing web site RRS feed

  • Question

  • I need to add email functionality in my web site , so how i should start from database prospectine. And i need to syschronise that email database with outlook. What should be my initial steps.
    Tuesday, June 9, 2009 11:50 AM

All replies

  • When you say you need to add email funcationality to your web site...why do you immediately jump to an email database?  What sort of site do you have?  Where are these emails being generated?  Is the email coming from the site itself, or are the emails part of the process of a stored procedure?

    From the website perspective, if your email is of a low frequency, you can add an EmailService class that handles communications for the site.  EmailService.SendRegistrationEmail()  This will keep all of your email communciations centralized an accessible to your code base.  A word of caution here though.  Notice I mentioned "of a low frequency" at the start.  I generally create an EmailService() which my code interacts with.  Then I have two sending mechanisms.  One for sending email through the .net classes that are built in and one for sending mail through a database mail queue (DBMQ - custom code) or through MSMQ (some custom code).  This way if traffic starts to grow you can disconnect the act of sending emails from the lifecycle of a web page. 

    I usually take this even further in that my EmailService will use StructureMap (or some other IoC container) so that I can say something like ObjectFactory.GetInstance<IEmail>().Send(message);  Then what is actually loaded in the place of IEmail is determined by configuration or through run time controls else where.  This allows me to test locally with a direct send method of sending email and then switching in production using the DBMQ method.

    Let me know if you have questions!

    Andrew Siemer www.andrewsiemer.com blog.andrewsiemer.com www.socialnetworkingin.net
    Tuesday, June 9, 2009 8:53 PM
  • Hi Andrew excuse me for long break in the conservation, I was on holidays. The information you have shared is really helpful. I am working on to use DBMQ or .net classes to send emails. But my main concern is how to manage the mails in the database. The web site I am working on required the email functionality, the emails from the same domain or may be from other domains. Also required is the email functionality to be configured on outlook. So what should be my architecture to synchronize with outlook to send receive emails?

    Monday, June 15, 2009 7:21 AM