?
Solved

Server.CreateObject Failed  - Invalid ProgID.

Posted on 2003-03-08
4
Medium Priority
?
742 Views
Last Modified: 2008-02-01

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
0
Comment
Question by:will77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 80 total points
ID: 8096513
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
 
LVL 4

Expert Comment

by:whammy
ID: 8100113
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
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8103509
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
 
LVL 58

Expert Comment

by:Gary
ID: 9353003
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question