Thread Title: Microsoft VBScript compilation error '800a0401' HELP CDOSYS ASP Problem

Thread Description (By: Carrzkiss):

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("Q_24413297.mdb") & ";"
objConn.Open

getS = Request.QueryString("ID")
Set objRs=Server.CreateObject("ADODB.RecordSet")
getSQL = "SELECT JBSSiteID, JBSMetaTitle, JBSLogo, JBSMetaKeywords, JBSMetaDescription, JBSURLShort, JBSNoReplyEmail, JBSURL, JBAPCV FROM JBSite WHERE JBSSiteID="& getS &""
objRs.Open getSQL, objConn, 1, 1, 1

FromAddress = (objRs("JBSNoReplyEmail"))

Dim myMail
Set myMail = CreateObject("CDO.Message")

'This section provides the configuration information for the remote SMTP server.

myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.domain.net"
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
'myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
'myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"
'myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"

myMail.Configuration.Fields.Update
Attach=(objRs("JBAPCV"))

'End remote SMTP server configuration section==

myMail.To = "webmaster@pcitdad.com"
myMail.ReplyTo="webmaster@cffcd.net"
myMail.Subject = "Sending of file"&Attach&""
myMail.From = FromAddress

' we are sending a text email.. simply switch the comments around to send an html email instead
'myMail.HTMLBody = "this is the body"
myMail.TextBody = "Sending of file G:\InetPub\wwwroot\EE\Q_24413297\"&Attach&""
' we are send a file over the code, so we have to add in the fully qualified address to the location of the file. Then add in our Varilable for the file.
myMail.AddAttachment "G:\InetPub\wwwroot\EE\Q_24413297\"&Attach&""

myMail.Send

Set myMail = Nothing
Response.Redirect "../advertisefree.html"
Recordset1.Close()
Set Recordset1 = Nothing

%>


Q_24413297
Sorry, there is no Demo for this Article
Download Code (Some codes do not have .zip files with them, sorry!)


This Thread has been viewed: [ 471 ] times

Visit Carrzkiss of Experts Exchange at the following locations.
CFF Coding Source
=>Coding Source
Coding Source is a site designed for sharing of source codes, from different forms of software.
With over 100 Members and growing nearly every day!
Knowledge Base<=
Our Knowledge Base, is packed full of information to help you overcome your coding and trouble shooting issues.

Designed by: EE's very own Carrzkiss.
You know Carrzkiss from his reputation on Experts Exchange, now see his work in action.

EE.CFFCS.COM is Brought to you
by: CFFCS.COM - Carrz-Fox-Fire Coding Source) A ®Carrz-Fox-Fire Promotions©2000-2023 Company