CDO.Message.1 error '8004020c'

G

Guest

Im trying to use a form through a flash file. the flash file calls the .asp
script then i get this error

CDO.Message.1 error '8004020c' At least one recipient is required, but none
were found./contact.asp, line 20

Here is the asp script what is wrong
does the recipient need an address?
<%
Set reg = New RegExp
reg.Pattern = "^[A-Za-z0-9\._\-]+@([A-Za-z0-9\._\-]+\.)+[A-Za-z0-9\._\-]+$"
Set m = reg.Execute(Request.QueryString("your_email"))

if m.count > 0 then
smtpServer = "swapper.loc"
smtpPort = 25

name = Request.QueryString("your_name")
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "from " & name
myMail.From = Request.QueryString("your_email")
myMail.To = Request.QueryString("recipient")
myMail.HTMLBody = "<html><head><title>Contact
letter</title></head><body><br>" & Request.QueryString("message") &
"</body></html>"
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpServer
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpPort
myMail.Configuration.Fields.Update
myMail.Send
Response.Write("Your email was sent")
else
Response.Write("Invalid email")
End if

%>
<script>
resizeTo(300, 300)
//window.close()
</script>
 
M

Mark Fitzpatrick

I would try dumping the various fields to the browser to make sure that you
are really getting the values you think. Try dumping the
Response.Write(Request.QueryString("recipient")) to make sure that the
recipient querystring variable is not blank. If it's blank, this would be
the error you would expect to see. If it is blank, make sure that the
spelling on all the form fields is correct. It's very easy to misspell it in
the form than try accessing it with the correct spelling in code.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
S

Stefan B Rusynko

PS
the simple regex will fail in many cases on valid email addresses according to RFC 822
For more robust ones see http://regexlib.com/Search.aspx?k=email

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I would try dumping the various fields to the browser to make sure that you
| are really getting the values you think. Try dumping the
| Response.Write(Request.QueryString("recipient")) to make sure that the
| recipient querystring variable is not blank. If it's blank, this would be
| the error you would expect to see. If it is blank, make sure that the
| spelling on all the form fields is correct. It's very easy to misspell it in
| the form than try accessing it with the correct spelling in code.
|
| Hope this helps,
| Mark Fitzpatrick
| Microsoft MVP - FrontPage
|
| | > Im trying to use a form through a flash file. the flash file calls the
| > .asp
| > script then i get this error
| >
| > CDO.Message.1 error '8004020c' At least one recipient is required, but
| > none
| > were found./contact.asp, line 20
| >
| > Here is the asp script what is wrong
| > does the recipient need an address?
| > <%
| > Set reg = New RegExp
| > reg.Pattern =
| > "^[A-Za-z0-9\._\-]+@([A-Za-z0-9\._\-]+\.)+[A-Za-z0-9\._\-]+$"
| > Set m = reg.Execute(Request.QueryString("your_email"))
| >
| > if m.count > 0 then
| > smtpServer = "swapper.loc"
| > smtpPort = 25
| >
| > name = Request.QueryString("your_name")
| > Set myMail = CreateObject("CDO.Message")
| > myMail.Subject = "from " & name
| > myMail.From = Request.QueryString("your_email")
| > myMail.To = Request.QueryString("recipient")
| > myMail.HTMLBody = "<html><head><title>Contact
| > letter</title></head><body><br>" & Request.QueryString("message") &
| > "</body></html>"
| > myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
| > = 2
| > myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
| > = smtpServer
| > myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
| > = smtpPort
| > myMail.Configuration.Fields.Update
| > myMail.Send
| > Response.Write("Your email was sent")
| > else
| > Response.Write("Invalid email")
| > End if
| >
| > %>
| > <script>
| > resizeTo(300, 300)
| > //window.close()
| > </script>
| >
| >
| > --
| > Slowly but surely
|
|
 

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