PDA

View Full Version : ASP code sending e-mail with Exchange Server 2003



WEBFOO
09-16-2005, 04:34 PM
I am in charge of creating a web program. This ASP program is a request form. The program should enter proper criteria for requests using textboxes and drop-down menus. One of the requirements are a valid e-mail address. This program will only be used by our employees. So all e-mail addresses are from our exchange server 2003. When you hit submit on the form, it should validate the form, insert the information into a database, and send an e-mail to the user's e-mail address.

The problem I am having is that when I connect to my SMTP, it requires authentication. So, I need to create a script that will automatically logon to the Exchange Server and will automatically authenticate my username and password (this will then allow me to send an e-mail to them) when the user presses the submit button. Any help would be appreciated.

Spoons
10-14-2005, 12:32 PM
obviously i've no idea how you have your exchange server configured, but you should be able to send an email using ASP and CDO with no problem assuming the "FROM" address is within your exchange domain...

i.e.

<%
' Sending email
Set myMail=CreateObject("CDO.Message")
myMail.From="anyname@exchangedomain.com"
myMail.To="someone@somedomain.com"
myMail.Cc="someoneelse@someotherdomain.com"
myMail.Bcc="someoneelse@athirdunknowndomain.com"
myMail.Subject="This is a test email"
myMail.TextBody="This is a test message."
myMail.Send
set myMail=nothing
%>