Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

error message mail to address

Participant ,
May 04, 2007 May 04, 2007

Copy link to clipboard

Copied

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

TOPICS
Server side applications

Views

448
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2007 May 04, 2007

Copy link to clipboard

Copied

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
%>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 04, 2007 May 04, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 07, 2007 May 07, 2007

Copy link to clipboard

Copied

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


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 08, 2007 May 08, 2007

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines