simoncpage2
Programmer
- Feb 21, 2004
- 37
Bit of newbie to asp but I have created a script for sending emails out for registration but I am getting the error:
Microsoft VBScript runtime error '800a0046'
Permission denied
/clpmarket/Market/aspmkrfn.asp, line 350
(line 350 being objMail.Send)
Now I am using the smtp from my exchnage server to send these email and I wasn't where the error orginates (the asp is on a hosted service for now I am using 7host.com and brinkster.com - 7hosts gives me error message and brinkster just says page cannot be displayed). Also the smtp works fine I have used smtp diagnostics to try sending an email throught that.
The error line 350 is from nt/2000 machine (and since my exhange server is on 2003 I assume it is not there that the error is - let me know if I am wrong).
Basically is this something that you get with free hosting and will it get sorted if I pay for a hosting service? If not how can I sort out this problem?
This is the full code:
If sIISVer <= "5.0" Then
' NT / 2000 using CDONTS
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = sFrEmail
objMail.To = sToEmail
If sCcEmail <> "" Then
objMail.Cc = sCcEmail
End If
If sBccEmail <> "" Then
objMail.Bcc = sBccEmail
End If
If LCase(sFormat) = "html" Then
objMail.BodyFormat = 0 ' 0 means HTML format, 1 means text
objMail.MailFormat = 0 ' 0 means MIME, 1 means text
End If
objMail.Subject = sSubject
objMail.Body = sMail
objMail.Send
Set objMail = Nothing
Else
' XP / 2003 using CDO
' Set up Mail
Set objMail = Server.CreateObject("CDO.Message")
sSmtpServer = "smtp.hoster.co.uk"
iSmtpServerPort = 25
If (sIISVer < "6.0") Or (sSmtpServer <> "" And LCase(sSmtpServer) <> "localhost") Then ' XP or not localhost
' Set up Configuration
Set objConfig = CreateObject("CDO.Configuration")
objConfig.Fields(" = 2 ' cdoSendUsingMethod = cdoSendUsingPort
objConfig.Fields(" = sSmtpServer ' cdoSMTPServer
objConfig.Fields(" = iSmtpServerPort ' cdoSMTPServerPort
objConfig.Fields.Update
Set objMail.Configuration = objConfig ' Use Configuration
End If
objMail.From = sFrEmail
objMail.To = sToEmail
If sCcEmail <> "" Then
objMail.Cc = sCcEmail
End If
If sBccEmail <> "" Then
objMail.Bcc = sBccEmail
End If
If LCase(sFormat) = "html" Then
objMail.HtmlBody = sMail
Else
objMail.TextBody = sMail
End If
objMail.Subject = sSubject
objMail.Send
Set objMail = Nothing
Set objConfig = Nothing
End If
End Sub
Microsoft VBScript runtime error '800a0046'
Permission denied
/clpmarket/Market/aspmkrfn.asp, line 350
(line 350 being objMail.Send)
Now I am using the smtp from my exchnage server to send these email and I wasn't where the error orginates (the asp is on a hosted service for now I am using 7host.com and brinkster.com - 7hosts gives me error message and brinkster just says page cannot be displayed). Also the smtp works fine I have used smtp diagnostics to try sending an email throught that.
The error line 350 is from nt/2000 machine (and since my exhange server is on 2003 I assume it is not there that the error is - let me know if I am wrong).
Basically is this something that you get with free hosting and will it get sorted if I pay for a hosting service? If not how can I sort out this problem?
This is the full code:
If sIISVer <= "5.0" Then
' NT / 2000 using CDONTS
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = sFrEmail
objMail.To = sToEmail
If sCcEmail <> "" Then
objMail.Cc = sCcEmail
End If
If sBccEmail <> "" Then
objMail.Bcc = sBccEmail
End If
If LCase(sFormat) = "html" Then
objMail.BodyFormat = 0 ' 0 means HTML format, 1 means text
objMail.MailFormat = 0 ' 0 means MIME, 1 means text
End If
objMail.Subject = sSubject
objMail.Body = sMail
objMail.Send
Set objMail = Nothing
Else
' XP / 2003 using CDO
' Set up Mail
Set objMail = Server.CreateObject("CDO.Message")
sSmtpServer = "smtp.hoster.co.uk"
iSmtpServerPort = 25
If (sIISVer < "6.0") Or (sSmtpServer <> "" And LCase(sSmtpServer) <> "localhost") Then ' XP or not localhost
' Set up Configuration
Set objConfig = CreateObject("CDO.Configuration")
objConfig.Fields(" = 2 ' cdoSendUsingMethod = cdoSendUsingPort
objConfig.Fields(" = sSmtpServer ' cdoSMTPServer
objConfig.Fields(" = iSmtpServerPort ' cdoSMTPServerPort
objConfig.Fields.Update
Set objMail.Configuration = objConfig ' Use Configuration
End If
objMail.From = sFrEmail
objMail.To = sToEmail
If sCcEmail <> "" Then
objMail.Cc = sCcEmail
End If
If sBccEmail <> "" Then
objMail.Bcc = sBccEmail
End If
If LCase(sFormat) = "html" Then
objMail.HtmlBody = sMail
Else
objMail.TextBody = sMail
End If
objMail.Subject = sSubject
objMail.Send
Set objMail = Nothing
Set objConfig = Nothing
End If
End Sub