View Single Post
  #1 (permalink)  
Old November 4th, 2009, 05:43 PM
futurehype futurehype is offline
Authorized User
Join Date: Oct 2009
Posts: 10
Thanks: 6
Thanked 1 Time in 1 Post
Default Microsoft VBScript runtime error '800a000d' error

Hi there, as I've mentioned in earlier posts I'm a designer and just getting into the coding side of things. Been building a shopping cart using various plug ins and everything is going fine apart from when I try to send out the customers confirmation email.

I have two files. One called orderconfirmed.asp and another called functions_email.asp

In theory orderconfirmed.asp should trigger functions_email.asp and send an email to the customer (The whole process is triggered by IPN from Paypal hopefully)

So I'm getting this error:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'SendEmail'

/orderconfirmed.asp, line 69

Here's the order confirmed page with line 69 highlighted.

SendEmail CustomersRS("CustomerEmail")

<!--#include file="Connections/CharonCart.asp" -->
Dim OrderID,CustomerID
CustomerID=Request.Cookies("Products")("CustomerID ")
Dim CustomersRS__value
CustomersRS__value = "0"
if (CustomerID <> "") then CustomersRS__value = CustomerID
Dim OrderDetailsRS__value1
OrderDetailsRS__value1 = "0"
if (OrderID <> "") then OrderDetailsRS__value1 = OrderID
Dim OrdersRS__value
OrdersRS__value = "0"
if (OrderID <> "") then OrdersRS__value = OrderID
set CustomersRS = Server.CreateObject("ADODB.Recordset")
CustomersRS.ActiveConnection = MM_CharonCart_STRING
CustomersRS.Source = "SELECT * FROM Customers WHERE CustomerID=" + Replace(CustomersRS__value, "'", "''") + ""
CustomersRS.CursorType = 0
CustomersRS.CursorLocation = 3
CustomersRS.LockType = 3
CustomersRS_numRows = 0
set OrderDetailsRS = Server.CreateObject("ADODB.Recordset")
OrderDetailsRS.ActiveConnection = MM_CharonCart_STRING
OrderDetailsRS.Source = "SELECT *,UnitPrice*Quantity as LineTotal FROM OrderDetails WHERE OrderID=" + Replace(OrderDetailsRS__value1, "'", "''") + ""
OrderDetailsRS.CursorType = 0
OrderDetailsRS.CursorLocation = 2
OrderDetailsRS.LockType = 3
OrderDetailsRS_numRows = 0
set OrdersRS = Server.CreateObject("ADODB.Recordset")
OrdersRS.ActiveConnection = MM_CharonCart_STRING
OrdersRS.Source = "SELECT * FROM Orders WHERE OrderID=" + Replace(OrdersRS__value, "'", "''") + ""
OrdersRS.CursorType = 0
OrdersRS.CursorLocation = 2
OrdersRS.LockType = 3
OrdersRS_numRows = 0
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
OrderDetailsRS_numRows = OrderDetailsRS_numRows + Repeat1__numRows
<!--#include file="functions_email.asp" -->
'This is the part where we send out emails.
'There's a 101 different ways of doing it.
'The function used are in the file functions_email.asp
'Basically you can edit the template in Email.asp, the function will send that page as a HTML email.
'So, you now have a choice to use CDONTS, JMail or ASP Mail. Just comment/uncomment the appropriate lines below

SendEmail CustomersRS("CustomerEmail")

'Uncomment this line to see whats sent.
'Response.Write Mailbody

<title>Order Confirmed</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="Styles.css">
<!--#include file="Header.asp" -->
<div id="content">
<div id="breadCrumb">
<h2 id="pageName">Order Confirmed </h2>
<div class="story">
<table width="500" border="0" cellpadding="3">
<td valign="top">
<table width="100%" border="0" cellpadding="5" cellspacing="1" class="story">
<td valign="top" bgcolor="white"><b>Contact Information</b></td>
<td width="50%" rowspan="2" valign="top" bgcolor="white"><strong>OrderID: <%=(OrdersRS.Fields.Item("OrderID").Value)%><br>
Date: </strong><%=(OrdersRS.Fields.Item("OrderDate").Value )%> </td>
<td width="50%" valign="top" bgcolor="white"> <%=(CustomersRS.Fields.Item("FirstName").Value)%>& nbsp;<%=(CustomersRS.Fields.Item("LastName").Value )%><b><br>
<b>Phone:</b> <%=(CustomersRS.Fields.Item("Phone").Value)%><br >
<b>Fax:</b> <%=(CustomersRS.Fields.Item("Fax").Value)%><br>
<b>Email:</b> <%=(CustomersRS.Fields.Item("CustomerEmail").Value )%></td>
<tr bgcolor="#eeeeee">
<td width="50%" height="25"><b>Invoice details</b></td>
<td width="50%" height="25"><b>Delivery details</b></td>
<tr bgcolor="white">
<td width="50%" valign="top" bgcolor="white"> <%=(CustomersRS.Fields.Item("BillingAddress1").Val ue)%><br>
<%=(CustomersRS.Fields.Item("BillingRegion").Value )%><br>
<%=(CustomersRS.Fields.Item("BillingCountry").Valu e)%><br>
<%=(CustomersRS.Fields.Item("BillingPostalCode").V alue)%><br>
<td width="50%" valign="top" bgcolor="white"><%=(CustomersRS.Fields.Item("Deliv eryAddress1").Value)%> <br>
<%=(CustomersRS.Fields.Item("DeliveryAddress2").Va lue)%><br>
<%=(CustomersRS.Fields.Item("ShipCity").Value)%><b r>
<%=(CustomersRS.Fields.Item("BillingCountry").Valu e)%><br>
<%=(CustomersRS.Fields.Item("ShipPostalCode").Valu e)%></td>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="story">
<tr bgcolor="#eeeeee" class="tableheader">
<td width="6%" valign="middle"><b>Qty</b></td>
<td width="35%" valign="middle"><b>Item</b></td>
<td width="13%" valign="middle"><strong>Size</strong></td>
<td width="13%" valign="middle"><strong>Colour</strong></td>
<td width="19%" height="25" align="right" valign="middle"><b>Unit
<td width="14%" align="right" valign="middle"><b>Total</b></td>
While ((Repeat1__numRows <> 0) AND (NOT OrderDetailsRS.EOF))
<tr bgcolor="#FFFFFF">
<td align=center valign=middle bgcolor=#FFFFFF><%=(OrderDetailsRS.Fields.Item("Qu antity").Value)%> </td>
<td height="30" valign="middle" bgcolor=#FFFFFF><%=(OrderDetailsRS.Fields.Item("Pr oductName").Value)%><br>
<td valign=middle bgcolor=#FFFFFF><%=(OrderDetailsRS.Fields.Item("Pr oductSize").Value)%></td>
<td valign=middle bgcolor=#FFFFFF><%=(OrderDetailsRS.Fields.Item("Co lour").Value)%></td>
<td align="right" valign=middle bgcolor=#FFFFFF>&pound;<%= FormatNumber((OrderDetailsRS.Fields.Item("UnitPric e").Value), 2, -2, -2, -2) %></td>
<td align="right" valign=middle bgcolor=#FFFFFF>&pound;<%= FormatNumber((OrderDetailsRS.Fields.Item("LineTota l").Value), 2, -2, -2, -2) %></td>
<table width="100%" border="0" cellpadding="5" cellspacing="1" class="story">
<td width="32%" rowspan="5" valign="top">&nbsp;</td>
<td width="68%" align="right"> Total:&pound;<%= FormatNumber((OrdersRS.Fields.Item("SubTotal").Val ue), 2, -2, -2, -2) %> </td>
<td align="right">Discount:&pound;<%= FormatNumber((OrdersRS.Fields.Item("Discount").Val ue), 2, -2, -2, -2) %></td>
<td align="right">Shipping:&pound;<%= FormatNumber((OrdersRS.Fields.Item("Freight").Valu e), 2, -2, -2, -2) %> </td>
<td align="right"> <b>Grand Total: &pound;<%= FormatNumber((OrdersRS.Fields.Item("GrandTotal").V alue), 2, -2, -2, -2) %> </b> </td>
<td align="right">(VAT:&pound;<%= FormatNumber((OrdersRS.Fields.Item("SalesTax").Val ue), 2, -2, -2, -2) %>)</td>
<table width="500" border="0">
<tr align="center" valign="top">
<td class="story">
<p>Thank you for your order. Please <a href="javascript:window.print()">print
this page</a> if you require an invoice.</p> </td>
<!--#include file="footer.asp" -->
<div class="story"></div>
<!--#include file="NavBar.asp" -->
'Uncomment the following lines to abandon the Session and kill the cart

and my email_functions page

'Start the functions
function SendEmail(c)
Set objMail = Server.CreateObject("CDO.Message")
'This section provides the configuration information for the remote SMTP server.

objMail.Configuration.Fields.Item ("") = 2 'Send the message using the network (SMTP over the network).
objMail.Configuration.Fields.Item ("") ="???"
objMail.Configuration.Fields.Item ("") = 25
objMail.Configuration.Fields.Item ("") = False 'Use SSL for the connection (True or False)
objMail.Configuration.Fields.Item ("") = 60

' If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
objMail.Configuration.Fields.Item ("") = 1 'basic (clear-text) authentication
objMail.Configuration.Fields.Item ("") ="websales@???"
objMail.Configuration.Fields.Item ("") ="???"


'End remote SMTP server configuration section==

objMail.From = "websales@???"
objMail.To = c
objMail.Bcc = "orders@???" 'Maybe send a CC to your sales office
objMail.Subject = "Your order from ???"
objMail.HTMLBody = Mailbody
'objMail.TextBody = mailbody
Set objMail = Nothing
end function

As I say I'm new to coding so I appologies if it's a stupid mistake on my part. I've been banging my head against a brick wall on it so any help is really appreciated.

Thanks in advance
Reply With Quote