If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP Form Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-27-04, 11:13
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
ASP Form Problem

Hi Volk

Well, it's my first time I post something in your Forum, and I hope
I don't gonna made some people cry. ^^
I already looked in the Internet if I could find any solution, but without sucsess. -_-

Well, my problem is, I get no error from the compiler, and since three day, sometime it works and sometime id do not. But three month long it worked without problem. No I ask me, are this a fault im my code or is it a Web sever error. It's not my Web Server, this one who work with Windows NT. with a ISS Version. (I don't know the version.)

Well, now to my Problem. I made a Form with ASP and used this code.

Example:

Over this, I have only normal HTML and the Language code.

<%@ LANGUAGE="VBSCRIPT" %>
<html>.......

<% Dim strMessage

strMessage=""

'Antragsteller
tx_FirstName= Trim(Request.Form("tx_FirstName"))
ect.
ect.
44 Line at all.

So I tuck every form name in this code.

Then I have some If, Else, End if request.

***************
If tx_FirstName = "" Then
Response.Write "<div align=center><font size=4>Bitte füllen Sie auch alles aus!</font><p>Wir benötigen alles was mit einem Stern --><font color=#FF0000> *</font> angeschrieben ist! <p><a href=javascript:history.back()>Zurück zum Formular</a></div>"
else
***************

Ok, new the Message for the E-Mail

strHtml = "<html><head></head><body bgcolor=ffffff>"
strHtml = strHtml & "<strong><u>Antragsteller:</u></strong> " & "<br>"
strHtml = strHtml & tx_berechtigung_vn3 & "<br>"
*****************************3
ect.
With the request from the Form. "tx_berechtigung”

Then I configured the code for sending to the Mail sever.
Then a If, Else, End if again.
*****************************
If Mailer.SendMail Then
SendMail = True
m_errortext = "Das eMail wurde erfolgreich ans Helpdesk TSS versendet."
Else
SendMail = False
m_errortext = Mailer.Response
****************************
Set Mailer = Nothing
If SendMail = True then
Response.Write "Bla bla bla"

else
end if

%>
****************************

If somebody wants to see the code, it would make my happy.
I didn't want to post all the code.

So did I something wrong, or is this ok, how I did it.

Last edited by Jseiler; 01-27-04 at 11:16.
Reply With Quote
  #2 (permalink)  
Old 01-27-04, 17:28
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
The only thing I would add is a check for null values in your request fields so you have have

Code:
If tx_FirstName = "" or isNull( tx_FirstName) Then
instead of...

Code:
If tx_FirstName = "" Then
and I would set a default value for SendMail so you would have

Code:
SendMail = False
If Mailer.SendMail Then
SendMail = True
m_errortext = "Das eMail wurde erfolgreich ans Helpdesk TSS versendet."
Else
m_errortext = Mailer.Response

instead of

Code:
If Mailer.SendMail Then
SendMail = True
m_errortext = "Das eMail wurde erfolgreich ans Helpdesk TSS versendet."
Else
SendMail = False
m_errortext = Mailer.Response
When it "wasn't working" what was happening? Were the emails not being sent and no message was being posted?
Reply With Quote
  #3 (permalink)  
Old 01-28-04, 03:15
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
Hi rokslide,

Hey thanks for your posting.
I gonne try out your proposals.

Well, it happens nothing. The answer page come, and writ "Your Request was not send." and I got no error message back from the Mail server, or from the script, and in the log file from the Server, it's nothing written inside. *I gonna turn mad*

And it worked tree moths without problems. I don't understand at all.
Everybody say, it's because of my code. I don't say, it it's not impossible, but it's very queer at all. :-/

Well, I try this proposals out and will report what happen, let see if it help

Last edited by Jseiler; 01-28-04 at 03:18.
Reply With Quote
  #4 (permalink)  
Old 01-28-04, 03:19
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Good luck. If you attach the rest of the code (you can attach files to posts) then I will have a look if I get a chance and let you know if I see anything else.
Reply With Quote
  #5 (permalink)  
Old 01-28-04, 03:26
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
Thank you.
I will do, but first I have to try I out.

See you later
Reply With Quote
  #6 (permalink)  
Old 01-28-04, 03:52
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
Well, I got again the same error.

"Your request could not be send."
Ok, it's my own answer.

Well I put my code in, maybe with them it is easier to find the error.
Thank you very much, I think I gonna try to set up my one Web Server,
and try it, maybe it's the Web server at all. *gg*
But i think it's my fault....... ^^

Last edited by Jseiler; 01-29-04 at 01:01.
Reply With Quote
  #7 (permalink)  
Old 01-28-04, 19:31
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Hi there,

Thanks for uploading the file. Unfortunately the machine I'm on can't rar, it can only zip and I don't have access to download something that will rar.

Can you post the straight asp file?

Cheers
Reply With Quote
  #8 (permalink)  
Old 01-29-04, 01:08
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
Hi,

Ups, well now here the asp file. Sorry, didn't now. ^^
(Sorry, I change the ending to txt, asp is not allowed.)

Man, here in the Switzerland it's Snowing, like I never seen at all.
Also in Bern, at all. ^^
How's the weather in Sydney? I think it's fine.
Attached Files
File Type: txt berechtigung.txt (22.8 KB, 29 views)
Reply With Quote
  #9 (permalink)  
Old 01-29-04, 18:31
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
change this line (it's about 9 from the bottom)
Code:
Response.Write " <p><div align=center>Ihr Antrag konnte nicht gesendet werden, bitte rufen Sie am Helpdesk an.</div>"
add
Code:
Response.Write " <p><div align=center>Ihr Antrag konnte nicht gesendet werden, bitte rufen Sie am Helpdesk an.</div>"
Response.Write m_errortext
This will mean that when the mailer fails you should see the error message as to why it failed.

Looking at the code you have it all looks good. I would guess that the mailing component has a fault or the SMTP server has a fault. Writing out the m_errortext value should help you determine exactly what is happening though an prove it is not your code that is at fault.

Sydney is quite warm at the moment 22 degrees C, aiming for a high of 29 degrees.... I haven't seen a decent fall of snow in about 4 years (which is when I moved here).
Reply With Quote
  #10 (permalink)  
Old 01-30-04, 01:43
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
Hi ther ^^

Funny, I tried this code, but just at this moment it never give me out any error Message, and now it give me one out.

FromAddress Property cannot be blank. ???

Very strange. :-/

Where are you original from? America, Britannia? ^^
Reply With Quote
  #11 (permalink)  
Old 01-30-04, 05:12
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
Hi again. ^^

Now I tried to install the Apache server "XAMPP" with Mod_Perl asp.
Well, I think with them it should work. But now I get from Line 41 to 199 + 444 follow error...... Bareword found where operator expected at

I upped the logfile.......

Well, however, I try now to find the newest ISS with ASP, with Apache it definitely do not work.
Attached Files
File Type: txt error.txt (40.2 KB, 32 views)
Reply With Quote
  #12 (permalink)  
Old 01-31-04, 23:51
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Okie. From what you have told me you code is perfect except for the fact that is it not checking for errors that the mail component raises and it is not checking the data to ensure that when it tries to send an email it is comple (eg. the required fields are populated).

Basically you need to found out what the email component believes is a required field and only send an email if they are completed.

I'm orginally from New Zealand.
Reply With Quote
  #13 (permalink)  
Old 02-02-04, 09:18
Jseiler Jseiler is offline
Registered User
 
Join Date: Jan 2004
Location: Bern
Posts: 9
Hmm, ok.

But why did it work so long, and now after three month I don't work anymore? I think it is a sever error. It can't be.
Well, however, now the enterprise set up a new server for me.
Well let see, if it help.

>Basically you need to found out what the email component believes is
>a required field and only send an email if they are completed.

If I do right understand you mean, the mailserver must akzept the frommail with the entry or they will put out the error message "FromAddress Property cannot be blank."

Ohh, New Zealand is so wonderfull, was there not turned the Movie Lord of the Rings?
Reply With Quote
  #14 (permalink)  
Old 02-02-04, 18:45
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Yes, you understand correctly.

Now the reason why it may have been working perfectly but no longer works,.... it's possible that the component can no longer reach the STMP server to send the email. It's possible that the component relies on some other components that have been uninstalled, or updated... there are other possibilities as well,...

Yes, New Zealand is very nice, there is not much work there though, that is why I am in Australia.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On