Help please!!! I got this error message :
Application ErrorNumber: 70 (0x00000046)Source: Microsoft VBScript runtime errorDescription: Permission denied
My IIS server and Exchange 2003 server are both windows 2003. According to several posts listed here, i can use CDONT if i register its dll on my exchange server, right? I got this error when I use CDONT. here's my public.asp using CDONT:*********************Case 1 'CDONTS Set Mail = Server.CreateObject("CDONTS.NewMail") Mail.BodyFormat = 1 ' Text Only, 0 for HTML Mail.Subject = strSubject Mail.To = strToAddr Mail.Body = strBody Mail.Send(Cfg(cnnDB, "HDName") & "<" & Cfg(cnnDB, "HDReply") & ">") Set Mail = Nothing**********************This happens at the new.asp page when i click on "Submit Problem" button which takes me to the postnew.asp page. I'm using SQL server 2005, not Access.
oh man..it doesn't let me write a long email :)
anyway, it's working now...there're 3 steps involved in order to use CDOSYS:
- add a record for CDOSYS on tblConfig_Email table
- under Configure Site, select CDOSYS
- update public.asp to use CDOSYS
If anyone could give me a little help with this, I would be grateful. I am trying to get CDOSYS working, I have edited the public.asp so that CASE 5 is CDOSYS (after looking at various posts on the forum), but now I realise that I have to make it an option to choose in the configuration, BUT can someone please tell me where I edit the tblConfig?
Thanks in advance
Angie
Add this into tblconfig_Email:
ID: 5
Type: CDOSYS
This is what it should look like:
I am hoping someone out here can help me. I have been using this great Help Desk solution for many years. We switch to Google Apps (GMail), but can not get it to send email through Google Apps. I have done some reprogramming of the code and tried CDOSYS settings, but not been able to get it to work. Can someone look at my code below and see if there is something I am doing wrong. I would even be willing to hire someone to work on this project for me.
Thanks,
Ron KramerConsultants On Call
Select Case Cfg(cnnDB, "EmailType")
Case 0 'No Email
Case 2 'CDONTS
Set Mail = Server.CreateObject("CDO.Message")
Mail.Subject = strSubject
Mail.To = strToAddr
Mail.From = Cfg(cnnDB, "HDReply")
Mail.TextBody = strBody
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.gmail.com"
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")="my email @ my domain"
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")="My Password"
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=465
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")=True
Mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")=60
Mail.Configuration.Fields.Update
Mail.Send
Set Mail = Nothing
Case 2 'Jmail
On Error Resume Next ' Use Jmail logging
Set Mail = Server.CreateObject("Jmail.Message")
Mail.Logging = True
Mail.FromName = Cfg(cnnDB, "HDName")
Mail.AddRecipient strToAddr
Mail.Body = strBody
If Not Mail.Send(Cfg(cnnDB, "SMTPServer")) Then
If Application("Debug") Then
Call DisplayError(3, Mail.Log)
End If
Case 3 'ASPEmail
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = Cfg(cnnDB, "SMTPServer")
Mail.AddAddress strToAddr
Case 4 ' ASPMail
Set Mail = Server.CreateObject("SMTPsvg.Mailer")
Mail.FromAddress = Cfg(cnnDB, "HDReply")
Mail.RemoteHost = Cfg(cnnDB, "SMTPServer")
Mail.AddRecipient "Help Desk User", strToAddr
Mail.BodyText = strBody
Mail.SendMail
End Select
Your missing the 5th Case :) In BOLD at the bottom...
______________________________________________________
' SendMail:' Sends mail using the supported system set in global.asaSub SendMail (strToAddr, strSubject, strBody, cnnDB)
Dim Mail
If Not Application("Debug") Then On Error Resume NextEnd If
Select Case Cfg(cnnDB, "EmailType") Case 0 'No Email
Case 1 'CDONTS Set Mail = Server.CreateObject("CDONTS.NewMail") Mail.BodyFormat = 1 ' Text Only, 0 for HTML Mail.Subject = strSubject Mail.To = strToAddr Mail.Body = strBody Mail.Send(Cfg(cnnDB, "HDName") & "<" & Cfg(cnnDB, "HDReply") & ">") Set Mail = Nothing
Case 2 'Jmail On Error Resume Next ' Use Jmail logging Set Mail = Server.CreateObject("Jmail.Message") Mail.Logging = True Mail.From = Cfg(cnnDB, "HDReply") Mail.FromName = Cfg(cnnDB, "HDName") Mail.AddRecipient strToAddr Mail.Subject = strSubject Mail.Body = strBody If Not Mail.Send(Cfg(cnnDB, "SMTPServer")) Then If Application("Debug") Then Call DisplayError(3, Mail.Log) End If End If Set Mail = Nothing
Case 3 'ASPEmail Set Mail = Server.CreateObject("Persits.MailSender") Mail.Host = Cfg(cnnDB, "SMTPServer") Mail.From = Cfg(cnnDB, "HDReply") Mail.FromName = Cfg(cnnDB, "HDName") Mail.AddAddress strToAddr Mail.Subject = strSubject Mail.Body = strBody Mail.Send Set Mail = Nothing
Case 4 ' ASPMail Set Mail = Server.CreateObject("SMTPsvg.Mailer") Mail.FromName = Cfg(cnnDB, "HDName") Mail.FromAddress = Cfg(cnnDB, "HDReply") Mail.RemoteHost = Cfg(cnnDB, "SMTPServer") Mail.AddRecipient "Help Desk User", strToAddr Mail.Subject = strSubject Mail.BodyText = strBody Mail.SendMailCase 5 ' CDOSYS DIM strIncomingMailServer, objCDOSYSMail, objCDOSYSCon 'Create the e-mail server object strIncomingMailServer = Cfg(cnnDB, "SMTPServer") Set objCDOSYSMail = Server.CreateObject("CDO.Message") Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Set and update fields properties With objCDOSYSCon
'Out going SMTP server .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strIncomingMailServer 'SMTP port .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'CDO Port .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Timeout .Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 .Fields.Update End With
'Update the CDOSYS Configuration Set objCDOSYSMail.Configuration = objCDOSYSCon
With objCDOSYSMail .From = Cfg(cnnDB, "HDName") & " <" & Cfg(cnnDB, "HDReply") & ">" .To = strToAddr .Subject = strSubject '.HTMLBody = strBody 'Set the e-mail body format (HTMLBody=HTML TextBody=Plain) .TextBody = strBody 'Send the e-mail If NOT strIncomingMailServer = "" Then .Send End with
'Close the server mail object Set objCDOSYSMail = Nothing
__________________________________________________________________________
Also you did not mention if you are using access or sql but in access you need to add this following info to the tblConfig_Email:
(Image below)
Hope this helps... :)
I am awaiting for code to show so in the mean tme here is the code in an image... Paste after case 4
Also if you need to add the following to the tblConfig_Email: