p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 18th, 2009, 06:58 PM
Registered User
Points: 39, Level: 1
Points: 39, Level: 1 Points: 39, Level: 1 Points: 39, Level: 1
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Oct 2009
Posts: 10
Thanks: 6
Thanked 0 Times in 0 Posts
Default cdosys email issue

Hi there, just got involved in coding(ish) and am strugling through. I'm a designer by trade so all of the technical stuff is tough. So please be patient with me as this may hopefully very easy to fix. Basically I'm getting this error from my forgoten password

Microsoft VBScript runtime error '800a01c2'

Wrong number of arguments or invalid property assignment: 'SendEmail'

/forgotten_password.asp, line 27

This is the code without the details which I know are correct as I've tested them via a test page

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/mydb.asp" -->
<%
Dim UsersRS__value
UsersRS__value = "0"
If (Request("Email") <> "") Then
UsersRS__value = Request("Email")
End If
%>
<%
Dim UsersRS
Dim UsersRS_numRows
Set UsersRS = Server.CreateObject("ADODB.Recordset")
UsersRS.ActiveConnection = MM_mydb_STRING
UsersRS.Source = "SELECT * FROM Customers WHERE CustomerEmail='" + Replace(UsersRS__value, "'", "''") + "' "
UsersRS.CursorType = 0
UsersRS.CursorLocation = 2
UsersRS.LockType = 3
UsersRS.Open()
UsersRS_numRows = 0
%>
<%
if Request("Selected") <> "" then
UserEmail=Request("Email")
if not UsersRS.eof then
UserPassword=UsersRS("CustomerPassword")
SendEmail
Response.Redirect "forgotten_password.asp?success=true"
else
end if
end if
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") ="intmail"
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.Subject = "Your password"
objMail.HTMLBody = Mailbody
'objMail.TextBody = mailbody
'objMail.MailFormat=0
'objMail.BodyFormat=0
objMail.Send
Set objMail = Nothing
end function
%>
<html>
<head>
<title>Forgotten Password</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="Styles.css">
</head>
<body bgcolor="#FFFFFF">
<!--#include file="Header.asp" -->
<div id="content">
<div id="breadCrumb">
</div>
<h2 id="pageName">Forgotten Password </h2>
<div class="story">
<h3>
<%if Request("success") = "" then%>
</h3>
<form name="form1" method="post" action="forgotten_password.asp">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="story">
<tr>
<td colspan="2" class="detail" >
Please enter your email address.</td>
</tr>
<tr>
<td colspan="2" >&nbsp;</td>
</tr>
<%if Request("failed") <> "" then%>
<tr>
<td height="24" colspan="2" align="center" >Your
Email address is not in our database.</td>
</tr>
<%end if%>
<tr>
<td width="30%" height="29" align="right"> <strong>Your
Email Address:</strong></td>
<td width="70%" >
<input name="Email" type="text" class="search-box" id="Email3" size="35">
</td>
</tr>
<tr>
<td width="30%" height="6" align="center">&nbsp;</td>
<td v height="6" width="70%"><input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table>
<input type="hidden" name="Selected" value="1">
</form>
<%else%>
<br>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">Thank you. Your password has been emailed
to you.</td>
</tr>
</table>
<%end if%>
</div>
<p>
<!--#include file="footer.asp" -->
</p>
</div>
<!--#include file="NavBar.asp" -->
</body>
</html>
<%
UsersRS.Close()
Set UsersRS = Nothing
%>

Thanks in adavnce

David
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 18th, 2009, 07:10 PM
Friend of Wrox
Points: 5,604, Level: 31
Points: 5,604, Level: 31 Points: 5,604, Level: 31 Points: 5,604, Level: 31
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,666
Thanks: 6
Thanked 9 Times in 9 Posts
Send a message via AIM to mat41
Default

Next time you post point out the offending line. help others help you!!

'SendEmail' does expect a parameter which looks like an email address. I assume the error is here?

UserPassword=UsersRS("CustomerPassword")
SendEmail (THIS LINE)
Response.Redirect "forgotten_password.asp?success=true"
else

if so try chnaging this line to SendEmail(someAddress@someone.com)
__________________
Wind is your friend
Matt

http://www.elitemarquees.com.au
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old October 18th, 2009, 07:49 PM
Registered User
Points: 39, Level: 1
Points: 39, Level: 1 Points: 39, Level: 1 Points: 39, Level: 1
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Oct 2009
Posts: 10
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Sorry about not highlighting. I didn't think.

But thanks for the quick reply. If I add an email address after SendEmail function the form, I'm guessing will only go to the address that I have placed in the code. The aim of the form is for the user to type in their email address then this page will pick their password from the database and send it to them. Is there a variable that I am missing which I have misplaced?

Thanks again

David
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old October 18th, 2009, 08:06 PM
Friend of Wrox
Points: 5,604, Level: 31
Points: 5,604, Level: 31 Points: 5,604, Level: 31 Points: 5,604, Level: 31
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,666
Thanks: 6
Thanked 9 Times in 9 Posts
Send a message via AIM to mat41
Default

mmmmmm I will ask it another way:

Wrong number of arguments or invalid property assignment: 'SendEmail'

/forgotten_password.asp, line 27

Where is line 27
__________________
Wind is your friend
Matt

http://www.elitemarquees.com.au
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old October 18th, 2009, 08:52 PM
Registered User
Points: 39, Level: 1
Points: 39, Level: 1 Points: 39, Level: 1 Points: 39, Level: 1
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Oct 2009
Posts: 10
Thanks: 6
Thanked 0 Times in 0 Posts
Default

hi this is line 27

SendEmail

thanks again
david
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old October 18th, 2009, 09:01 PM
Friend of Wrox
Points: 5,604, Level: 31
Points: 5,604, Level: 31 Points: 5,604, Level: 31 Points: 5,604, Level: 31
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,666
Thanks: 6
Thanked 9 Times in 9 Posts
Send a message via AIM to mat41
Default

;;; If I add an email address after SendEmail function the form, I'm guessing will only go to the address that I have placed in the code.

An email will go to the address you pass into the function yes (providing the function is free of bugs)

;;;Is there a variable that I am missing which I have misplaced?
No but you, as I have said, are trying to call a function which expects a value to be passed to it. If you want this value to be the emai address you need to change this line to:

SendEmail(UserEmail)

Provided that is a vaid email address and providing there are no other code errors it should work. it will solve your current error.
__________________
Wind is your friend
Matt

http://www.elitemarquees.com.au
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to mat41 For This Useful Post:
futurehype (October 19th, 2009)
  #7 (permalink)  
Old October 19th, 2009, 08:39 PM
Registered User
Points: 39, Level: 1
Points: 39, Level: 1 Points: 39, Level: 1 Points: 39, Level: 1
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Join Date: Oct 2009
Posts: 10
Thanks: 6
Thanked 0 Times in 0 Posts
Smile

Thanks for the help. I've got it sorted now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic CDOSYS email form question ottostudios Classic ASP Professional 1 August 14th, 2009 06:18 AM
ASP / CDOSYS - Performance issue worldofrugs ASP.NET 2.0 Professional 0 May 1st, 2008 11:40 AM
Sending email with CDOSYS Tee88 ASP CDO 17 April 19th, 2005 05:00 PM
Sending Email using CDOSYS in ASP asplearner ASP CDO 6 February 16th, 2005 02:48 AM
Sending out Large Email Blasts with CDOSYS Aaron Edwards ASP Pro Code Clinic 0 April 16th, 2004 12:10 PM



All times are GMT -4. The time now is 02:20 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc