Hi All,

I have following code that redirects e-mailing depending the environment it was sent from. This works for the PRD server but not for the DEV server. I've tested this functionality in Oracle just to make sure everything is fine with the servers, however when doing this from MS Access/VBA it displays "the transport failed to connect to the server" error message.

Sub SendMessage(strTo As String, strSubject As String, strBody As String, strCustodianName As String)


Dim iMsg As New CDO.Message
Dim iConf As New CDO.Configuration


With iConf.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
If (InStr(g_str_conn, "PRD") > 0) Then
.Item(cdoSMTPServer) = "prd.mail.gov"
Else
.Item(cdoSMTPServer) = "dev.mail.com"
End If
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Update
End With


With iMsg
Set .Configuration = iConf
.To = strTo
.From = """From e-mail"" <frome-mail@lbl.gov>"
.Subject = strSubject
.TextBody = strBody


.send
End With


Set iMsg = Nothing
Set iConf = Nothing


End Sub