Connecting Tech Pros Worldwide Help | Site Map

CDO.Message sent whenever page loads, though the form not submitte

whyyyy
Guest
 
Posts: n/a
#1: Jul 10 '06
The script below works fine if the form is filled out and submitted.

But a (blank) e-mail is sent whenever the page loads, even when the form is
not submitted. I would like to receive the e-mail only when the form is
submitted


<%@LANGUAGE="VBSCRIPT"%>
<%
Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From=" rate_al@yahoo.com"
MyMail.To="arte@gmail.com"
MyMail.Cc=""
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
%>

Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.

But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.

So I have two questions, and am obviously a novice.

This forum has been a lifesaver in the past

Thanks

Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com

<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>
Ray Costanzo [MVP]
Guest
 
Posts: n/a
#2: Jul 10 '06

re: CDO.Message sent whenever page loads, though the form not submitte


There are a number of ways to check to see if the form has been posted. One
is Request.ServerVariables("REQUEST_METHOD")

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'''your code for e-mailing
End If


As for part 2, put the Response.Redirect in that IF block as well after the
code that sends the e-mail.


<%

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
''code for e-mail
Response.Redirect "confirmed.asp"
End If
%>

<form.....


Ray at work


"whyyyy" <whyyyy@discussions.microsoft.comwrote in message
news:C6231351-D170-4E30-9F7A-6AD43D51415B@microsoft.com...
Quote:
The script below works fine if the form is filled out and submitted.
>
But a (blank) e-mail is sent whenever the page loads, even when the form
is
not submitted. I would like to receive the e-mail only when the form is
submitted
Quote:
Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is
submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.
>
But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.
>
So I have two questions, and am obviously a novice.
>
This forum has been a lifesaver in the past
>
Thanks
>
Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com
>
<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>

whyyyy
Guest
 
Posts: n/a
#3: Jul 10 '06

re: CDO.Message sent whenever page loads, though the form not submitte


Hello Ray

Thanks

I'm not sure if you anserwed the first question, which is how to prevent a
bank e-mail from being sent every time the page is opened, whether or not the
form is submitted.

Thanks for the help with response.redirect, the second question

Sincerely

Alan



"Ray Costanzo [MVP]" wrote:
Quote:
There are a number of ways to check to see if the form has been posted. One
is Request.ServerVariables("REQUEST_METHOD")
>
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'''your code for e-mailing
End If
>
>
As for part 2, put the Response.Redirect in that IF block as well after the
code that sends the e-mail.
>
>
<%
>
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
''code for e-mail
Response.Redirect "confirmed.asp"
End If
%>
>
<form.....
>
>
Ray at work
>
>
"whyyyy" <whyyyy@discussions.microsoft.comwrote in message
news:C6231351-D170-4E30-9F7A-6AD43D51415B@microsoft.com...
Quote:
The script below works fine if the form is filled out and submitted.

But a (blank) e-mail is sent whenever the page loads, even when the form
is
not submitted. I would like to receive the e-mail only when the form is
submitted
>
>
Quote:
Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is
submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.

But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.

So I have two questions, and am obviously a novice.

This forum has been a lifesaver in the past

Thanks

Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com

<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>
>
>
>
Aaron Bertrand [SQL Server MVP]
Guest
 
Posts: n/a
#4: Jul 10 '06

re: CDO.Message sent whenever page loads, though the form not submitte


I'm not sure if you anserwed the first question, which is how to prevent a
Quote:
bank e-mail from being sent every time the page is opened, whether or not
the
form is submitted.
Did you see the "if / end if" parts of his response? That pretty much
answered the question.


whyyyy
Guest
 
Posts: n/a
#5: Jul 11 '06

re: CDO.Message sent whenever page loads, though the form not submitte


I tried to reply earlier but something went wrong. Unfortunately I don`t know
what the following terms mean, exactly, or even inexactly.
'''your code for e-mailing
''code for e-mail

But I tried various things and couldn`t get the page open at all until I put
this:

<%@LANGUAGE="VBSCRIPT"%>
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Set MyMail=CreateObject("CDO.Message")
Response.Redirect "confirmed.asp"
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From="arte@gmail.com"
MyMail.To="arte@gmail.com"
MyMail.Cc="alegrate_al@yahoo.com"
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
End If
%>

This appears to work beautifully. But, sadly, no e-mail is received when the
form id submitted.

So I need more help, please

Thanks

AL


"Ray Costanzo [MVP]" wrote:
Quote:
There are a number of ways to check to see if the form has been posted. One
is Request.ServerVariables("REQUEST_METHOD")
>
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'''your code for e-mailing
End If
>
>
As for part 2, put the Response.Redirect in that IF block as well after the
code that sends the e-mail.
>
>
<%
>
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
''code for e-mail
Response.Redirect "confirmed.asp"
End If
%>
>
<form.....
>
>
Ray at work
>
>
"whyyyy" <whyyyy@discussions.microsoft.comwrote in message
news:C6231351-D170-4E30-9F7A-6AD43D51415B@microsoft.com...
Quote:
The script below works fine if the form is filled out and submitted.

But a (blank) e-mail is sent whenever the page loads, even when the form
is
not submitted. I would like to receive the e-mail only when the form is
submitted
>
>
Quote:
Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is
submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.

But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.

So I have two questions, and am obviously a novice.

This forum has been a lifesaver in the past

Thanks

Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com

<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>
>
>
>
whyyyy
Guest
 
Posts: n/a
#6: Jul 11 '06

re: CDO.Message sent whenever page loads, though the form not submitte


Thank you Aaron

Unfortunately, I`m still in the dark

I sent another reply to Ray,

Thanks again

AL


"Aaron Bertrand [SQL Server MVP]" wrote:
Quote:
Quote:
I'm not sure if you anserwed the first question, which is how to prevent a
bank e-mail from being sent every time the page is opened, whether or not
the
form is submitted.
>
Did you see the "if / end if" parts of his response? That pretty much
answered the question.
>
>
>
Aaron Bertrand [SQL Server MVP]
Guest
 
Posts: n/a
#7: Jul 11 '06

re: CDO.Message sent whenever page loads, though the form not submitte


>I tried to reply earlier but something went wrong. Unfortunately I don`t
Quote:
>know
what the following terms mean, exactly, or even inexactly.
'''your code for e-mailing
''code for e-mail
That's the part that starts with Set MyMail = CreateObject("CDO.Message")
and ends with Set MyMail = Nothing
Quote:
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Set MyMail=CreateObject("CDO.Message")
Response.Redirect "confirmed.asp"
Why are you doing this here? You haven't set up the message or sent it yet.
Try moving this Response.Redirect line down to after the End If.

A


whyyyy
Guest
 
Posts: n/a
#8: Jul 12 '06

re: CDO.Message sent whenever page loads, though the form not submitte


I don`t want to check to see if the form has been posted

I want to stop a blank email from being sent whenever the page with the form
is opened. The email has nothing to do with the form.

I want e-mail to be sent when the submit button is pressed. It is sent when
the submit button is pressed, and the response redirect works fine.

The problem is if someone lands on the page an empty email is sent

Please help -- this is the general idea:

IF
submit button pressed
THEN
send email
ELSE
do nothing

Alan


"Ray Costanzo [MVP]" wrote:
Quote:
There are a number of ways to check to see if the form has been posted. One
is Request.ServerVariables("REQUEST_METHOD")
>
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'''your code for e-mailing
End If
>
>
As for part 2, put the Response.Redirect in that IF block as well after the
code that sends the e-mail.
>
>
<%
>
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
''code for e-mail
Response.Redirect "confirmed.asp"
End If
%>
>
<form.....
>
>
Ray at work
>
>
"whyyyy" <whyyyy@discussions.microsoft.comwrote in message
news:C6231351-D170-4E30-9F7A-6AD43D51415B@microsoft.com...
Quote:
The script below works fine if the form is filled out and submitted.

But a (blank) e-mail is sent whenever the page loads, even when the form
is
not submitted. I would like to receive the e-mail only when the form is
submitted
>
>
Quote:
Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is
submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.

But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.

So I have two questions, and am obviously a novice.

This forum has been a lifesaver in the past

Thanks

Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com

<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>
>
>
>
Aaron Bertrand [SQL Server MVP]
Guest
 
Posts: n/a
#9: Jul 12 '06

re: CDO.Message sent whenever page loads, though the form not submitte


The problem is if someone lands on the page an empty email is sent

When someone lands on the page, they did so because they didn't submit the
form. This is why you to check to see if the form has been posted.

While it may not be what you *want* to do, it's what you do to make it work
the way you want the result.
Quote:
IF
submit button pressed
You can check if the form was posted using Ray's method.
Or, you can check if any of the *required* fields on your form is not empty.
E.g.

if Request.Form("email") <"" then
...
' send mail
' redirect
end if

If you want onclick handling on the server side, maybe it's time to move to
ASP.Net. Because it doesn't seem like ASP works the way you *want* it to.

A


alan
Guest
 
Posts: n/a
#10: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte


I would be very happy if you could tell me where to find any form-mail script
that works with windows servers

cdont dont work any more
CDO.Message dont work either unless I had any idea what you guys are talking
about.

This worked somewhere, but didn`t work somewhwere else. I guess I'll try it
again

<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%

Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail
component.
Mail.FromName = "Reservas"
Mail.FromAddress= Request.Form("email1")
Mail.RemoteHost = "smtp.1and1.com"
Mail.AddRecipient "Saboriarte", "soniaserna7@yahoo.com"
Mail.AddRecipient "Saboriarte", "soniaserna@saboriarte.com"
Mail.AddRecipient "Saboriarte", "alegrate_al@yahoo.com"
Mail.Subject = "http://saboriarte.com/forminfo.asp"
Mail.BodyText = Request.Form("email1")
Mail.BodyText = Request.Form("tarifas")
Mail.BodyText = Request.Form("TAcomoda")
Mail.BodyText = Request.Form("cama_add")
Mail.BodyText = Request.Form("cama_added")
Mail.BodyText = Request.Form("persons")
Mail.BodyText = Request.Form("NPersonas")
Mail.BodyText = Request.Form("nights")
Mail.BodyText = Request.Form("NNoches")
Mail.BodyText = Request.Form("Dia")
Mail.BodyText = Request.Form("Mes")
Mail.BodyText = Request.Form("Ano")
Mail.BodyText = Request.Form("results")
Mail.BodyText = Request.Form("info")

%>
<HTML>
<%

if Mail.SendMail then
Response.Redirect ( "Gracias.asp")
else
Response.Write ""
end if

%>

AL


"Aaron Bertrand [SQL Server MVP]" wrote:
Quote:
Quote:
The problem is if someone lands on the page an empty email is sent
>
When someone lands on the page, they did so because they didn't submit the
form. This is why you to check to see if the form has been posted.
>
While it may not be what you *want* to do, it's what you do to make it work
the way you want the result.
>
Quote:
IF
submit button pressed
>
You can check if the form was posted using Ray's method.
Or, you can check if any of the *required* fields on your form is not empty.
E.g.
>
if Request.Form("email") <"" then
...
' send mail
' redirect
end if
>
If you want onclick handling on the server side, maybe it's time to move to
ASP.Net. Because it doesn't seem like ASP works the way you *want* it to.
>
A
>
>
>
James Jones
Guest
 
Posts: n/a
#11: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte


seems that you do not understand what they are trying to do. So instead of using other things such as requesting the method, we will do it all by form then......


here is what your basic code should look like............

you need to put YOUR form into the section that says "YOUR FORM CODE WILL NEED TO BE HERE"......

you will also need to add this line of code into your form:

<input type="hidden" name="action" value="send">




i really hope this helps.





*************EMAIL PAGE BEGIN**************


<%@LANGUAGE="VBSCRIPT"%>
<%
Dim action
action = Request.Form("action")

IF action = "send" Then
Dim email
email = request.form("email")

Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From=" rate_al@yahoo.com"
MyMail.To="arte@gmail.com"
MyMail.Cc=""
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
Response.Redirect "confirm.asp?email=" & email
Else
%>

************YOUR FORM CODE WILL NEED TO BE HERE....***************
ex...

<form action="email.asp" method="post">
<input type="hidden" name="action" value="send"*******YOU NEED TO ADD THIS TO YOUR FORM AS A HIDDEN FIELD FOR THIS TO WORK!!!
<input type="submit" value="Send Email">
</form>

<%
End IF
%>


****************EMAIL PAGE END******************



****************CONFRMATION PAGE BEGIN*******************

<%
Dim email
email = Request.QueryString("email")
%>

Hello <%=email%>! <br />
We have received your submission.


**************CONFIRMATION PAGE END***********************














James Jones














"whyyyy" <whyyyy@discussions.microsoft.comwrote in message news:C6231351-D170-4E30-9F7A-6AD43D51415B@microsoft.com...
Quote:
The script below works fine if the form is filled out and submitted.

But a (blank) e-mail is sent whenever the page loads, even when the form is
not submitted. I would like to receive the e-mail only when the form is
submitted


<%@LANGUAGE="VBSCRIPT"%>
<%
Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From=" rate_al@yahoo.com"
MyMail.To="arte@gmail.com"
MyMail.Cc=""
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
%>

Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.

But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.

So I have two questions, and am obviously a novice.

This forum has been a lifesaver in the past

Thanks

Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com

<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>
Aaron Bertrand [SQL Server MVP]
Guest
 
Posts: n/a
#12: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte


cdont dont work any more

CDONTS was deprecated because it sucked.
Quote:
CDO.Message dont work either unless I had any idea what you guys are
talking
about.
What does "dont work" mean?

Here is a script using CDO.Message. You just have to replace certain
elements with values appropriate for your environment:
http://www.aspfaq.com/2026
Quote:
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail
component.
You have to install this component sold by www.serverobjects.com ... but I
don't really recommend it because you don't need it.

Again, what is wrong with using CDO.Message?

A


alan
Guest
 
Posts: n/a
#13: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte


To James Jones and Aaron.

Thank you both for new approaches

"seems that you do not understand what they are trying to do" -- You got
that right


--
AL


"James Jones" wrote:
Quote:
seems that you do not understand what they are trying to do. So instead of using other things such as requesting the method, we will do it all by form then......
>
>
here is what your basic code should look like............
>
you need to put YOUR form into the section that says "YOUR FORM CODE WILL NEED TO BE HERE"......
>
you will also need to add this line of code into your form:
>
<input type="hidden" name="action" value="send">
>
>
>
>
i really hope this helps.
>
>
>
>
>
*************EMAIL PAGE BEGIN**************
>
>
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim action
action = Request.Form("action")
>
IF action = "send" Then
Dim email
email = request.form("email")
>
Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From=" rate_al@yahoo.com"
MyMail.To="arte@gmail.com"
MyMail.Cc=""
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
Response.Redirect "confirm.asp?email=" & email
Else
%>
>
************YOUR FORM CODE WILL NEED TO BE HERE....***************
ex...
>
<form action="email.asp" method="post">
<input type="hidden" name="action" value="send"*******YOU NEED TO ADD THIS TO YOUR FORM AS A HIDDEN FIELD FOR THIS TO WORK!!!
<input type="submit" value="Send Email">
</form>
>
<%
End IF
%>
>
>
****************EMAIL PAGE END******************
>
>
>
****************CONFRMATION PAGE BEGIN*******************
>
<%
Dim email
email = Request.QueryString("email")
%>
>
Hello <%=email%>! <br />
We have received your submission.
>
>
**************CONFIRMATION PAGE END***********************
>
>
>
>
>
>
>
>
>
>
>
>
>
>
James Jones
>
>
>
>
>
>
>
>
>
>
>
>
>
>
"whyyyy" <whyyyy@discussions.microsoft.comwrote in message news:C6231351-D170-4E30-9F7A-6AD43D51415B@microsoft.com...
Quote:
The script below works fine if the form is filled out and submitted.

But a (blank) e-mail is sent whenever the page loads, even when the form is
not submitted. I would like to receive the e-mail only when the form is
submitted


<%@LANGUAGE="VBSCRIPT"%>
<%
Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From=" rate_al@yahoo.com"
MyMail.To="arte@gmail.com"
MyMail.Cc=""
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
%>

Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.

But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.

So I have two questions, and am obviously a novice.

This forum has been a lifesaver in the past

Thanks

Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com

<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>
alan
Guest
 
Posts: n/a
#14: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte


Thanks again

When I used Request.ServerVariables("REQUEST_METHOD") = "POST", etc, either
the page didnt open or every thing appeared to be just fine, but no email was
sent
`
So I wrote it dont work (not real english, but, slang for it doesn`t work)
--

But the truth is: I`m sure that
Mr. Jones is correct: "seems that you do not understand"

Sincerely

AL




"Aaron Bertrand [SQL Server MVP]" wrote:
Quote:
Quote:
cdont dont work any more
>
CDONTS was deprecated because it sucked.
>
Quote:
CDO.Message dont work either unless I had any idea what you guys are
talking
about.
>
What does "dont work" mean?
>
Here is a script using CDO.Message. You just have to replace certain
elements with values appropriate for your environment:
http://www.aspfaq.com/2026
>
Quote:
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail
component.
>
You have to install this component sold by www.serverobjects.com ... but I
don't really recommend it because you don't need it.
>
Again, what is wrong with using CDO.Message?
>
A
>
>
>
Dave Anderson
Guest
 
Posts: n/a
#15: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte


alan wrote:
Quote:
When I used Request.ServerVariables("REQUEST_METHOD") = "POST"...
You could just as easily look for content in the Request.Form collection,
BTW.


Quote:
...either the page didnt open or every thing appeared to be just
fine, but no email was sent
Do you know how to read an ASP error message? If you actually reached a line
in which you called the Send() method of a CDO.Message object, but got no
error message, then the message was sent.

For some reason, I am already assuming that you have SMTP services running,
or have correctly figured out how to send via remote SMTP server. That is
probably an error on my part. But assuming you ARE running SMTP services
locally, take a look in your inetpub\mailroot tree for messages piling up in
[pickup], [badmail], or [queue]. If your messages are there, you have gotten
CDO working, and need to learn how to configure SMTP.

But you knew that already, right? Heh.


Quote:
So I wrote it dont work (not real english, but, slang for it
doesn`t work)
Aaron does not need a lesson in English. You need to learn to explain
yourself. Neither "dont work" nor "doesn't work" explicitly describes what
it DOES and what messages it REPORTS.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


alan
Guest
 
Posts: n/a
#16: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte



--

"But you knew that already, right? Heh". -- I was wondering about that,
but I think the server wants me to pay extra for it (the smtp service)

"have correctly figured out how to send via remote SMTP server". (Yes I
have, but I think the server wants me to pay extra for it (the smtp service)


"I am already assuming that you have SMTP services running", -- again, I was
wondering about that. In truth I haven,t set it up. I think the server wants
me to pay extra for it (the smtp service)

"Aaron does not need a lesson in English" -- He asked

I understand very little of this. I`m trying to learn and your response
has helped in this respect

Thank you

AL






"Dave Anderson" wrote:
Quote:
alan wrote:
Quote:
When I used Request.ServerVariables("REQUEST_METHOD") = "POST"...
>
You could just as easily look for content in the Request.Form collection,
BTW.
>
>
>
Quote:
...either the page didnt open or every thing appeared to be just
fine, but no email was sent
>
Do you know how to read an ASP error message? If you actually reached a line
in which you called the Send() method of a CDO.Message object, but got no
error message, then the message was sent.
>
For some reason, I am already assuming that you have SMTP services running,
or have correctly figured out how to send via remote SMTP server. That is
probably an error on my part. But assuming you ARE running SMTP services
locally, take a look in your inetpub\mailroot tree for messages piling up in
[pickup], [badmail], or [queue]. If your messages are there, you have gotten
CDO working, and need to learn how to configure SMTP.
>
Quote:
>
>
>
Quote:
So I wrote it dont work (not real english, but, slang for it
doesn`t work)
>
Aaron does not need a lesson in English. You need to learn to explain
yourself. Neither "dont work" nor "doesn't work" explicitly describes what
it DOES and what messages it REPORTS.
>
>
>
--
Dave Anderson
>
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
>
>
>
alan
Guest
 
Posts: n/a
#17: Jul 13 '06

re: CDO.Message sent whenever page loads, though the form not submitte


Dear James

The script below with the hidden field works perfectly. I needed only the
response redirect so didn't use any asp below the </FORM except this:
<%
End IF
%>

Again thank you and many blessings: Your help with this did the job

I apologoze to the others for my God-given ignorance

Thanks Again


<%@LANGUAGE="VBSCRIPT"%>
<%
Dim action
action = Request.Form("action")
IF action = "send" Then
Dim email
email = request.form("email")
Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From="viol@artetil.com"
MyMail.To=" arte@gmail.com"
MyMail.Cc="alegrate_al@yahoo.com"
MyMail.Bcc=""
MyMail.Subject="Ropa de Arte y Cuero"
MyMail.Send()
Set MyMail=Nothing
Response.Redirect "confirmed.asp?email=" & email
Else
%>
--
AL


"James Jones" wrote:
Quote:
seems that you do not understand what they are trying to do. So instead of using other things such as requesting the method, we will do it all by form then......
>
>
here is what your basic code should look like............
>
you need to put YOUR form into the section that says "YOUR FORM CODE WILL NEED TO BE HERE"......
>
you will also need to add this line of code into your form:
>
<input type="hidden" name="action" value="send">
>
>
>
>
i really hope this helps.
>
>
>
>
>
*************EMAIL PAGE BEGIN**************
>
>
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim action
action = Request.Form("action")
>
IF action = "send" Then
Dim email
email = request.form("email")
>
Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From=" rate_al@yahoo.com"
MyMail.To="arte@gmail.com"
MyMail.Cc=""
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
Response.Redirect "confirm.asp?email=" & email
Else
%>
>
************YOUR FORM CODE WILL NEED TO BE HERE....***************
ex...
>
<form action="email.asp" method="post">
<input type="hidden" name="action" value="send"*******YOU NEED TO ADD THIS TO YOUR FORM AS A HIDDEN FIELD FOR THIS TO WORK!!!
<input type="submit" value="Send Email">
</form>
>
<%
End IF
%>
>
>
****************EMAIL PAGE END******************
>
>
>
****************CONFRMATION PAGE BEGIN*******************
>
<%
Dim email
email = Request.QueryString("email")
%>
>
Hello <%=email%>! <br />
We have received your submission.
>
>
**************CONFIRMATION PAGE END***********************
>
>
>
>
>
>
>
>
>
>
>
>
>
>
James Jones
>
>
>
>
>
>
>
>
>
>
>
>
>
>
"whyyyy" <whyyyy@discussions.microsoft.comwrote in message news:C6231351-D170-4E30-9F7A-6AD43D51415B@microsoft.com...
Quote:
The script below works fine if the form is filled out and submitted.

But a (blank) e-mail is sent whenever the page loads, even when the form is
not submitted. I would like to receive the e-mail only when the form is
submitted


<%@LANGUAGE="VBSCRIPT"%>
<%
Set MyMail=CreateObject("CDO.Message")
MyMail.TextBody=Request.Form("name") & vbCrLf & _
Request.Form("email")& vbCrLf & _
Request.Form("phone")& vbCrLf & _
Request.Form("palaver")
MyMail.From=" rate_al@yahoo.com"
MyMail.To="arte@gmail.com"
MyMail.Cc=""
MyMail.Bcc=""
MyMail.Subject="cosas de cuero"
MyMail.Send()
Set MyMail=Nothing
%>

Part two: The script below could be part of the problem. It is in the html
body below the closing form tag </formand works when the form is submitted,
but I would prefer not to use it, but instead to have a redirect to a
confirmation page.

But if I use "response.redirect", the page with the form never opens. Only
the confirmation page opens.

So I have two questions, and am obviously a novice.

This forum has been a lifesaver in the past

Thanks

Alan Lipman
alegrate_al@yahoo.com
calipasofino@hotmail.com

<%
dim email
email=Request.Form("email")
If email<>"" Then
Response.Write("Hello " & email & "!<br />")
Response.Write("We have receved your submission")
End If
%>
Closed Thread