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