Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 22nd, 2004, 12:10 PM
Registered User
 
Join Date: Jan 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default sending mail using asp and exchange

I'm having a problem sending mail from our exchange server (which is also acting as our web server). No matter what code I use, even code that works fine on our intranet server (which doesn't run exchange) gives me a really UN-useful border 504 bad gateway alert. Here's a couple of examples of code that I've tried:

dim iMsg
set iMsg = CreateObject(CDO.Message)
iMsg.To = "[email protected]"
iMsg.Subject = "APPLICATION FROM WEBSITE DATE=" & date()
iMsg.From = "[email protected]"
iMsg.TextBody = "Course code: " & code & vbcrlf & vbcrlf &_
"Course title: " & title & vbcrlf & vbcrlf &_
"Full name: " & fname & vbcrlf & vbcrlf &_
"Requested interview date: " & day(intdate) & "/" & month(intdate) & "/" & year(intdate) & vbcrlf & vbcrlf &_
"Requested interview time: " & inttime & vbcrlf & vbcrlf &_
"Home telephone number: " & tel & vbcrlf & vbcrlf &_
"E-mail address: " & email & vbcrlf & vbcrlf & vbcrlf & vbcrlf &_
"Please do not reply to this email - the return address does not exist."

iMsg.Send

This works fine on our intranet server but not on the exchange box

Const CdoBodyFormatText = 1
Const CdoBodyFormatHTML = 0
Const CdoMailFormatMime = 0
Const CdoMailFormatText = 1

Dim Message
Set Message = CreateObject("cdonts.NewMail")
With Message
.To = "[email protected]"
.Subject = "test"
.Body = "test"
.MailFormat = CdoMailFormatText
.BodyFormat = CdoBodyFormatText
.From = "[email protected]"
.Send
End With

set Message = nothing

I got this from a google search but it also just throws me the 504 bad gateway error.

I'm wondering if it's some security issue with exchange 2000, but I'm really not sure.

Any assistance would be appreciated.

Pete
 
Old January 23rd, 2004, 07:11 AM
Registered User
 
Join Date: Jan 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Aha! I believe I've found the problem - our exchange server seems to be only set up to allow mail to be sent from the internal ip address. Problem is that if is we allow mail to be sent from the front facing ip it leaves us open to anyone who wants to bounce mail of our server. DOH!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Mail Using CDOSYS in ASP artarasan Classic ASP Basics 1 May 12th, 2008 06:11 PM
sending mail in asp.net2.0 sen22 ASP.NET 2.0 Basics 2 March 3rd, 2007 07:14 AM
Sending mail using asp.net 2.0 Roinka ASP.NET 2.0 Basics 0 May 15th, 2006 08:22 AM
Sending E-mail with ASP Varg_88 Classic ASP Basics 7 September 10th, 2004 09:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.