Originally posted by Podge
Are you sure that strMailServer is set correctly? Try hardcoding it or entering the i.p. address.
Ok.. fixed it.. BUT I'm not 100% sure how.
I tweaked the script.. set the strmailserver to "localhost", deleted and re-created the mail account I am using and re-created it without a leading "_" in the password as the hosting providers site didnt seem to like that.
Here's the script as it is on the website now..
<%
if trim(strFromName) = "" then
strFromName = strForumTitle
end if
Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields
'Set and update fields properties
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strMailServer
Flds("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false
Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdobasic
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Flds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxx@mltek.co.uk"
Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxx"
Flds("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "xxxxx@mltek.co.uk"
Flds.Update
Set objNewMail = Server.CreateObject("CDO.Message")
Set objNewMail.Configuration = iConf
'Format and send message
Err.Clear
objNewMail.To = strRecipients
objNewMail.From = strSender
objNewMail.Subject = strSubject
objNewMail.TextBody = strMessage
On Error goto 0
objNewMail.Send
If Err <> 0 Then
Err_Msg = Err_Msg & "<li>Your request was not sent due to the following error: " & Err.Description & "</li>"
End if
Set objNewMail = Nothing
on error goto 0
%>
So that seems to work great and I now have emails flowing even to external domains
Thank you very much for your help