internal web form using smtp email, IIS and exchange

Posted on 2011-10-27
Last Modified: 2012-05-12
I have the following scenario:

intranet server running 2008 server, iis 7
exchange server running exchange 2007

I want to create a form that when the submit button is pressed it sends an email using the exchange server to send it to an internal user.  Can someone give me the following steps:

1.  what if anything needs to be setup on the IIS?
2.  what is the code in the .asp file to send the email using the existing exchange server?

if someone can give me the exact Dreamweaver 5.5 file that will do the asp in step 2 that would be a great plus as all my development is done in dreamweaver.

Question by:Dwci
    LVL 28

    Accepted Solution

    1, you need to ensure that smtp server is installed in iis.
    2,  you will need CDO email component.

    something similar to this:

    Dim iMsg
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    Set Flds = iConf.Fields
    Flds(cdoSendUsingMethod)  = cdoSendUsingPort
    Flds(cdoSMTPServer)       = "Your Exchange Server Address here"
    Flds(cdoSMTPServerPort)   = 25
    Flds(cdoSMTPAuthenticate)     = cdoAnonymous ' 0
    With iMsg
     Set .Configuration = iConf
            .From = ""
            .To = ""&request.form("email") &""
         .Sender      = ""
         .cc          = ""
         .Subject     = "Your Subject title here"
         .HTMLBody = Replace(""&body&"",vbCrLf,"<br>"&vbCrLf)
    End With

    Open in new window

    LVL 28

    Expert Comment

    Thank you  but a couple of more things you will need to know. I am sure you will have figured them out but to reduce the stress of looking them up, you will need to add this line at the top of the page where you will be using the email component above:
    <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows XP Library" -->

    Open in new window

    Then notice this line above

         .HTMLBody = Replace(""&body&"",vbCrLf,"<br>"&vbCrLf)

    Specifically, this -> &body&

    You will need that in order to format your email with various stylings.

    You will need to format it with body="....." immediately after your query if you are hitting the db or you just remove it.

    When you get started and you run into trouble, post here again.

    Good luck

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Join & Write a Comment

    Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
    First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) ( is a much better solution when you need to p…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now