Server.CreateObject Failed - Invalid ProgID.


Please help as i am having this error
Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/will77/news/news/send_mail_function.inc, line 114

Invalid ProgID.

---------------------------------------------

This is the include page:send_mail_function.inc
<%
'Function to send an e-mail
Function SendMail(strEmailBody, strUserName, strUserEmail, strWebsiteName, strForumEmailAddress, strSubject, strMailComponent, blnHTML)

      'Dimension variables
      Dim objCDOSYSMail      'Holds the CDOSYS mail object
      Dim objCDOMail            'Holds the CDONTS mail object
      Dim objJMail            'Holds the Jmail object
      Dim objAspEmail            'Holds the Persits AspEmail email object
      Dim objAspMail            'Holds the Server Objects AspMail email object
      
      
      'Check the email body doesn't already have Web Wiz Forums
      If blnLCode = True AND Instr(strEmailBody, "Web Wiz Forums") = False Then
      
            'If HTML format then make an HTML link
            If blnHTML = True Then
                  strEmailBody = strEmailBody & "stem"
            'Else do a text link
            Else
                  strEmailBody = strEmailBody & VbCrLf & VbCrLf & "---------------------------------------------------------------------------------------"
                  strEmailBody = strEmailBody & VbCrLf & ""
                  strEmailBody = strEmailBody & VbCrLf & ""
            End If
      End If

      'Select which email component to use
      Select Case strMailComponent
      
            'CDOSYS mail component
            Case "CDOSYS"
                  
                  'Dimension variables
                  Dim objCDOSYSCon
                  
                  'Create the e-mail server object
                  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      
                        'Who the e-mail is from
                        .From = strWebsiteName & " <" & strForumEmailAddress & ">"
                                          
                        'Who the e-mail is sent to
                        .To = strUserName & " <" & strUserEmail & ">"
                                                      
                        'The subject of the e-mail
                        .Subject = strSubject
                                          
                        'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
                        If blnHTML = True Then
                               .HTMLBody = strEmailBody
                        Else
                              .TextBody = strEmailBody
                        End If
                                          
                        'Send the e-mail
                        If NOT strIncomingMailServer = "" Then .Send
                  End with                        
                                          
                  'Close the server mail object
                  Set objCDOSYSMail = Nothing
            
            'CDONTS mail component
            Case "CDONTS"
            
                  'Create the e-mail server object
                  Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
            
                  With objCDOMail
                        'Who the e-mail is from
                        .From = strWebsiteName & " <" & strForumEmailAddress & ">"
                                          
                        'Who the e-mail is sent to
                        .To = strUserName & " <" & strUserEmail & ">"
                                                      
                        'The subject of the e-mail
                        .Subject = strSubject
                                          
                        'The main body of the e-amil
                        .Body = strEmailBody
                                          
                        'Set the e-mail body format (0=HTML 1=Text)
                        If blnHTML = True Then
                              .BodyFormat = 0
                        Else
                              .BodyFormat = 1
                        End If
                        
                        'Set the mail format (0=MIME 1=Text)
                        .MailFormat = 0
                                          
                        'Importance of the e-mail (0=Low, 1=Normal, 2=High)
                        .Importance = 1
                                          
                        'Send the e-mail
                        .Send      
                  End With                  
                                          
                  'Close the server mail object
                  Set objCDOMail = Nothing
                              
            
            'JMail component
            Case "Jmail"
      
                  'Create the e-mail server object
                  Set objJMail = Server.CreateObject("JMail.SMTPMail")
                  
                  With objJMail
                        'Out going SMTP mail server address
                        .ServerAddress = strIncomingMailServer
                  
                        'Who the e-mail is from
                        .Sender = strForumEmailAddress
                        .SenderName = strWebsiteName
                                          
                        'Who the e-mail is sent to
                        .AddRecipient strUserEmail
                                                            
                        'The subject of the e-mail
                        .Subject = strSubject
                        
                        'Set the e-mail body format (BodyHTML=HTML Body=Text)
                        If blnHTML = True Then
                              .HTMLBody = strEmailBody
                        Else
                              .Body = strEmailBody
                        End If
                                          
                        'Importance of the e-mail
                        .Priority = 3
                                          
                        'Send the e-mail
                        If NOT strIncomingMailServer = "" Then .Execute      
                  End With                  
                                          
                  'Close the server mail object
                  Set objJMail = Nothing
      
      
            'AspEmail component
            Case "AspEmail"
      
                  'Create the e-mail server object
                  Set objAspEmail = Server.CreateObject("Persits.MailSender")
                  
                  With objAspEmail
                        'Out going SMTP mail server address
                        .Host = strIncomingMailServer
                              
                        'Who the e-mail is from
                        .From = strForumEmailAddress
                        .FromName = strWebsiteName
                              
                        'Who the e-mail is sent to
                        .AddAddress strUserEmail
                                                                              
                        'The subject of the e-mail
                        .Subject = strSubject
                        
                        'Set the e-mail body format (BodyHTML=HTML Body=Text)
                        If blnHTML = True Then
                              .IsHTML = True
                        End If
                        
                        'The main body of the e-mail
                        .Body = strEmailBody
                                                            
                        'Send the e-mail
                        If NOT strIncomingMailServer = "" Then .Send      
                  End With            
                                    
                  'Close the server mail object
                  Set objAspEmail = Nothing
                  
            'AspMail component
            Case "AspMail"
             
                     'Create the e-mail server object
                     Set objAspMail = Server.CreateObject("SMTPsvg.Mailer")
               
                     With objAspMail
                           'Out going SMTP mail server address
                           .RemoteHost = strIncomingMailServer
                      
                           'Who the e-mail is from
                           .FromAddress = strForumEmailAddress
                           .FromName = strWebsiteName
                      
                           'Who the e-mail is sent to
                           .AddRecipient " ", strUserEmail
                              
                           'The subject of the e-mail
                           .Subject = strSubject
                    
                           'Set the e-mail body format (BodyHTML=HTML Body=Text)
                           If blnHTML = True Then
                                  .ContentType = "text/HTML"
                           End If
                    
                           'The main body of the e-mail
                           .BodyText = strEmailBody
                          
                           'Send the e-mail
                           If NOT strIncomingMailServer = "" Then .SendMail
                     End With  
                 
                     'Close the server mail object
                     Set objAspMail = Nothing
      End Select      
      
      'Set the returned value of the function to true
      SendMail = True
End Function
%>

-------------------------------
Thank you
will77Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fritz_the_blankCommented:
It is difficult to say for certain, but it looks like your code is trying to send mail with a component that is not registered or is not configured properly.

Fritz the Blank
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
whammyCommented:
I would agree... are you hosting this site yourself, or are you using another host?

I received _exactly_ the same message a long, long time ago when I first started using brinkster.com as a host for one of my sites, and tried to send a CDONTS email:


Server.CreateObject Failed

... insert page here ...

Invalid ProgID.


brinkster.com doesn't register the CDONTS .dll (if I understand their policy) on the "free" servers, so fritz is most likely correct. ;-)
0
fritz_the_blankCommented:
Most hosting companies do support at least one mailing script, so you just need to find out what it is and then code for that.

Fritz the Blank
0
GaryCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by fritz_the_blank

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.