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")

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/CharonCart.asp" -->
<%
Dim OrderID,CustomerID
OrderID=Session("OrderID")
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.Open()
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.Open()
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.Open()
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")
'SendJmailEmail
'SendAspMailEmail
SendAspEmailEmail

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

%>
<html>
<head>
<title>Order Confirmed</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="Styles.css">
</head>
<body TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 bgcolor="#FFFFFF" onLoad="">
<!--#include file="Header.asp" -->
<div id="content">
<div id="breadCrumb">
</div>
<h2 id="pageName">Order Confirmed </h2>
<div class="story">
<table width="500" border="0" cellpadding="3">
<tr>
<td valign="top">
<table width="100%" border="0" cellpadding="5" cellspacing="1" class="story">
<tr>
<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>
</tr>
<tr>
<td width="50%" valign="top" bgcolor="white"> <%=(CustomersRS.Fields.Item("FirstName").Value)%>& nbsp;<%=(CustomersRS.Fields.Item("LastName").Value )%><b><br>
</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>
<tr bgcolor="#eeeeee">
<td width="50%" height="25"><b>Invoice details</b></td>
<td width="50%" height="25"><b>Delivery details</b></td>
</tr>
<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>
<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>
</tr>
</table>
<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
Price</b></td>
<td width="14%" align="right" valign="middle"><b>Total</b></td>
</tr>
<%
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>
<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>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
OrderDetailsRS.MoveNext()
Wend
%>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="1" class="story">
<tr>
<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>
</tr>
<tr>
<td align="right">Discount:&pound;<%= FormatNumber((OrdersRS.Fields.Item("Discount").Val ue), 2, -2, -2, -2) %></td>
</tr>
<tr>
<td align="right">Shipping:&pound;<%= FormatNumber((OrdersRS.Fields.Item("Freight").Valu e), 2, -2, -2, -2) %> </td>
</tr>
<tr>
<td align="right"> <b>Grand Total: &pound;<%= FormatNumber((OrdersRS.Fields.Item("GrandTotal").V alue), 2, -2, -2, -2) %> </b> </td>
</tr>
<tr>
<td align="right">(VAT:&pound;<%= FormatNumber((OrdersRS.Fields.Item("SalesTax").Val ue), 2, -2, -2, -2) %>)</td>
</tr>
</table></td>
</tr>
</table>
<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>
</tr>
</table>
<p>
<!--#include file="footer.asp" -->
</p>
</div>
<div class="story"></div>
</div>
<!--#include file="NavBar.asp" -->
</body>
</html>
<%
'Uncomment the following lines to abandon the Session and kill the cart
'Session.Abandon
'Response.Cookies("CharonCart")=""
%>
<%
CustomersRS.Close()
%>
<%
OrderDetailsRS.Close()
%>
<%
OrdersRS.Close()
%>

and my email_functions page

<title>???</title><%
'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 ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="???"
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

' If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="websales@???.co.uk"
objMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="???"

objMail.Configuration.Fields.Update

'End remote SMTP server configuration section==

objMail.From = "websales@???.co.uk"
objMail.To = c
objMail.Bcc = "orders@???.co.uk" 'Maybe send a CC to your sales office
objMail.Subject = "Your order from ???"
objMail.HTMLBody = Mailbody
'objMail.TextBody = mailbody
'objMail.MailFormat=0
'objMail.BodyFormat=0
objMail.Send
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
David
Reply With Quote