• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

internal web form using smtp email, IIS and exchange

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.

  • 2
1 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 = "someemail.com"
        .To = ""&request.form("email") &""
     .Sender      = "someemail.com"
     .cc          = "someemail.com"
     .Subject     = "Your Subject title here"
     .HTMLBody = Replace(""&body&"",vbCrLf,"<br>"&vbCrLf)
End With

Open in new window

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now