Click to See Complete Forum and Search --> : problem with cdonts and ... life?


bttrflii
06-13-2005, 11:29 AM
i found the newsletter dealing with sending email with cdonts, and the sample code worked perfectly. (http://www.htmlgoodies.com/primers/asp/article.php/3478001)

when i started integrating the code into the page i was building, it was working fine as well. i kept it very simple and the form still only sent the email field in the actual email (just like the sample did) while i continued to add parts to the form.

where i run into problems is that i'm no longer getting email from the form. this was anticipated as i'm no expert on this. however, the original test form (which i haven't changed) *also* is not working any longer. i tried using gmail to send my work email a message, my work email to send my work email a message, and both the sample and my own cdonts code to send the form email to my coworker and gmail. none of them work, and i can't think of a scenario i didn't try. i asked a fellow employee to send me an email just regularly, and that *did* work. i find it very weird that she could send me an email but gmail couldn't. i have no idea if testing the code so many times messed something up, or even if anyone here would have a clue what happened.

any reply is appreciated, since i know this doesn't exactly fall under your category. if i should be asking in another place, just let me know. i'm long past the point of being frustrated, so i hope *someone* can find some humor in my situation. :) my dream for today is that this is a simple little problem only newbs miss. <crosses fingers>


link to text version (http://larsondata.com/temp.txt) of my problem page, if that helps.

thanks everyone.
~cj

bttrflii
06-13-2005, 12:04 PM
it seems funny to me that not 10 minutes after i finally break down and ask for help that the situation suddenly fixes itself. :-/ both my coworker and i got a mass load of emails from both forms at the same time from all of my previous get-this-to-work attempts, and now my version of the code is sending me timely emails again.

i didnt see an option to delete my original post, or i would have taken my clutter off of the forums.

many thanks to anyone that was thinking about this for me.

~cj

phpnovice
06-13-2005, 12:08 PM
Well, can't help you with your problems in life... ;) ...but let's see if we can figure out the problem with ASP sending mail. First, and foremost, whether ASP can successfully send mail or not is going to be directly dependent upon what is available on the server where your ASP code resides. So... Where do you host your site?

If you're hosting with an IPP then an explanation for this could be that your provider upgraded their server(s) and CDONTS is no longer supported. The latest Microsoft object for sending mail is CDOSYS. Thus, you would have to check with your host and find out what they support. They can also provide you with a sample script and/or documentation for using whatever it is that they provide for sending mail from ASP.

phpnovice
06-13-2005, 12:18 PM
...delete double post...

bttrflii
06-13-2005, 12:58 PM
my problem stemmed from both the sample code page and my own form page were working fine one minute, and the next minute neither worked. it was a very abrupt this-ain't-working-any-more attitude. then all of a sudden it started working again, quite a while after it had stopped working. i can only guess that the server got backed up or something? i truly have no idea. :(

while i've got you trying to figure out how to help my life though, i do have an asp question for ya.

the form i'm working with is going to be sending us information on which datasheet customers want us to send them. i've got the product list coming out of a database, the form set up, and the email working. what i need is to get the checked products in the email. i tried putting a do-while loop in, but i was getting a syntax error on the "do" line.

link: http://larsondata.com/products/datasheet.asp
code segment (including the do-while loop that i took back off the live web page so it would load for you): Set oMail = Server.CreateObject("CDONTS.NewMail")
With oMail
.From = sEmailAddr
.To = "@gmail.com"
.Subject = "test round #2"
.Body = "MDS Data Sheets have been requested!" & vbcrlf & vbcrlf & _
"Organization: " & Request.Form("org") & vbcrlf & _
"Name: " & Request.Form("name") & vbcrlf & _
"Address: " & Request.Form("city") & ", " & _
Request.Form("state") & vbcrlf & _
"Phone: " & Request.Form("phone") & vbcrlf & _
"Email: " & Request.Form("email") & vbcrlf & vbcrlf & _
"Notes: " & Request.Form("notes") & vbcrlf & vbcrlf & _
"Requested Data Sheet(s): " & vbcrlf & _
do while not objRS.eof
If Request.Form(objRS("Item")).Selected
objRS("Item") & vbcrlf & _
End If
objRS.movenext
loop
.Send
End With
Set oMail = Nothing

ideas, advice, or links to guides are all great. :)

once again, many thanks,
~ cj

phpnovice
06-13-2005, 01:14 PM
The error was not on the Do While... The error was on the next line. There is no Selected property on the server side and you're missing the Then keyword. If you receive a value, then the form element was selected. The client browser does not transmit empty, unchecked, or unselected form field content to the server.

To test for such a value, use the following:

If Len(Request.Form(objRS("Item")) > 0 Then