Skip to main content
May 5, 2007
Question

error message mail to address

  • May 5, 2007
  • 1 reply
  • 486 views
i have a form that i want to send an email to the address that is submitted in the form.

i get the following error message for this line of code
ObjSendMail.To = "<%=cStr(Request.Form("textfield"))%>"
'error message'
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/PRCleaning/test.asp, line 95, column 40
ObjSendMail.To = "<%=cStr(Request.Form("textfield"))

what should the code be?

thanks for your help

This topic has been closed for replies.

1 reply

May 5, 2007
think i have fixed that code; but now getting a different error.

Error Type:
(0x8004020F)
The event class for this subscription is in an invalid partition
/PRCleaning/test.asp, line 91

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="joinclub@prcleaningsupply.com"
myMail.To="(Request.Form(textfield))"
myMail.TextBody="click on this link for current special & vbCrlf & http://www.prcleaningsupply.com/product_special_club_4-07.asp"
myMail.Configuration.Fields.Item _
(" http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
(" http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="smtp.east.cox.net"
'Server port
myMail.Configuration.Fields.Item _
(" http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send 'this is line 91'
set myMail=nothing
%>
Inspiring
May 8, 2007
sure is

When calling an element such as a form value you don't enclose it in ", as
these tell the server to expect a string. The line should be

ObjSendMail.To = cStr(Request.Form("textfield"))


--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"jim balthrop" <webforumsuser@macromedia.com> wrote in message
news:f1gs4f$mpo$1@forums.macromedia.com...
> my problem must be with the TO Address
>
> now i get this syntax error with the following code
> Microsoft VBScript compilation (0x800A03EA)
> Syntax error
> /PRCleaning/test.asp, line 78, column 11
> myMail.To= & cStr(cStr(Request.Form("textfield")))
>
>


May 9, 2007
yes that worked. thanks for your help; but i still seem to have a problem with the server(some type of restriction)
the form will only send to addresses within my domain. outside of the domain, i get error message 503