At least one recipient is required, but none were found.

T

TechNinja

I hope I have the right newsgroup. I searched all groups under this
error message and can't seem to find the problem - which for all
purposes seemes to be a session issue.

I have a page that collects information that submits to a confirmation
page. The confirmation page shows all fields entered, using session
information - response.write Request("fieldname") and then hidden form
fields with the value of each session, e.g. <input name="fieldname"
type="hidden" value="<%= Request("clientFirstName") %>">. Once the
user hits submit on this confirmation page, the information is
submitted to the database with a redirect to to a sendmailscript page
(with a CDOSYS mail script that is supposed to send the user a thank
you email). This page then redirects automatically to the thank you
page (so the mailscript page is not resubmitted if the user hits
refresh. Everything works perfectly without the mailscript, but it
appears the sessions are not being carried across to this page because
it get the following error:

CDO.Message.1 (0x8004020C)
At least one recipient is required, but none were found.

The recipient cannot resolve this -> objMail.To =
Request("emailfield")
If I place an email address there instead, it works perfectly ->
objMail.To = "(e-mail address removed)"

I have reqorked this so many different ways, and believe it or not, I
have it working fine elsewhere for another reason (newsletter signup)
- I have checked my code - and compared the documents involved -
everything is in perfect order.

For some reason, my sessions are not crossing from the confirm page to
the mailscript page.

I can include my code if needed.
 
M

Mark Fitzpatrick

Probably the best group for this is actuall the
microsoft.public.inetserver.asp.general newsgroup, but we'll give it a shot.

Have you tested to see if the Request("emailfield") actually contains
something? Also, just using the Request() is really, really bad. First off,
it's a massive performance hit. Second, it's unpredictable. Both of these
stem from the fact that since you didn't specify the particular collection
to use, QueryString, Form, ServerVariables, and Cookies, it will go and
search all of these. That can lead to the case where you may have, say a
form value and a querystring value. Which one will it grab? You can never
relaly know. It could just be grabbing the wrong variable here. Also, since
you don't specify which collection to use it has to scan each collection,
including ServerVariables. ServerVariables can be the most labor intensive
one as ASP has to request the variables from the server in order to try to
match one.

Try playing with using a Response.Write with your emailfield to see if there
really is anything in it. I think the error is leading you down the wrong
road about error in the email mechanism itself as this is a common mishap.
 
T

TechNinja

Thanks Mark,

I will look to post in that thread if my next question is out of range
for this thread - but in regards to your post, which was very helpful,
I notice that even if I remove all the CDO mailscript from that page,
I can't even use a standard response.write Request("fieldname"), as on
the previous page. I still have the session in the header being used:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../cn/cnString.asp" -->
<% Session("fieldID")=Request.Form("fieldID") %>
<% Session("fieldFirstName")=Request.Form("fieldFirstName") %>
<% Session("fieldLastName")=Request.Form("fieldLastName") %>
<% Session("fieldEmailAddress")=Request.Form("fieldEmailAddress") %>
.......

For some reason, that session is not carrying across to this page, as
it did in the previous page where the response.write
Request("fieldEmailAddress") was working. I just seem to have lost
the ability to carry the session. I was using Cookies - but prefer
not to for user reasons - but even that didn't work.

Any help would be appreciated.

Thanks,

Jim
 
S

Stefan B Rusynko

That's because you session variable needs to be created on the 1st page the form sends to
(your confirmation page), not the next page they go to as say

<% Session("fieldEmailAddress")=Request.Form("fieldEmailAddress") %>

Then you can display it in the confirmation page using say
<% =Session("fieldEmailAddress") %>
And use it in your Email script

But there is no need for the session variables at all
- you really shouldn't create session variables if you only need them once

Since you say you have them click on a button on the confirmation page, make the button a form and pass you data as hidden form
fields
Set the values in the form as say

<input type="hidden" name="fieldEmailAddress" value="<% =Request.Form("fieldEmailAddress") %>">
-

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Thanks Mark,
|
| I will look to post in that thread if my next question is out of range
| for this thread - but in regards to your post, which was very helpful,
| I notice that even if I remove all the CDO mailscript from that page,
| I can't even use a standard response.write Request("fieldname"), as on
| the previous page. I still have the session in the header being used:
|
| <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
| <!--#include file="../cn/cnString.asp" -->
| <% Session("fieldID")=Request.Form("fieldID") %>
| <% Session("fieldFirstName")=Request.Form("fieldFirstName") %>
| <% Session("fieldLastName")=Request.Form("fieldLastName") %>
| <% Session("fieldEmailAddress")=Request.Form("fieldEmailAddress") %>
| ......
|
| For some reason, that session is not carrying across to this page, as
| it did in the previous page where the response.write
| Request("fieldEmailAddress") was working. I just seem to have lost
| the ability to carry the session. I was using Cookies - but prefer
| not to for user reasons - but even that didn't work.
|
| Any help would be appreciated.
|
| Thanks,
|
| Jim
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top