I am trying to validate the email in a form and then insert them into a database. I try the validation and it works, however when I try to populate a database with the emails it works the first time, after that it gives me the HTTP 500.100 Error. Here is my code:
Im running a simple mail system program which emails newsletters to a database list of 3000+ users.
The program loops through a database containing the emails and sends them out using ASPEmail.
My question is, is there some way i can validate each email address so that if there are invalid characters e.g. the space in "blah @blah.com" it will skip the record and continue the loop.
At the moment i have a working program however, whenever the program comes across an invalid email address it stops at that record and prevents the program from emailing any further.
I have been trying to use a function that checks that an email is syntactically correct (ie. it contains @ and .), however I have given up with the method I was trying - at the end of my tether I was. I would like something in the form of one of my other validation msgs below. Any ideas? Code:
Is there a way to validate a text box to make sure that the text field, which will house an email address, is in the proper format of name@domain.com/net etc?
I've got a couple of strings I use to validate emails.
I have no idea what either of them do or what they mean! I found them, they work, so I use them!
Could somebody let me know what these mean? My guess is that the longer string is better, simply because it tests more thoroughly, but I could be mistaken.
hey. i have been trying to validate an email field within asp page. the problem we have is that the field accepts more than one @ and all the validation codes for email does not restrict the use of one @. we are using indexOf(), lastIndexOf() and .Length methods to work with the problem. we tried to substract the lastIndexOf from the length and compare it to the indexOf to verify that the first time an @ symbol appears is the same as the last one.
l = consumer.email.value.length; s = consumer.email.value.indexOf(at); a = consumer.email.value.lastIndexOf(at); if (s !== l-a) { err += "*Please enter a valid email<br>"; }
I'm trying to validate a form which sends an e-mail. This is the code which sends the e-mail but i want to know what code i need to validate particular fields of the form and link it back to the previous page (index.asp) if unsuccessful. Code:
if there is a way to validate email addresses further. For example I just received an email from this person:-
cvx@fcxgf.fgfd
Obviously some fool trying to f**k with my form and send me a test email.
Because an array of countries have different extentions, can I not somehow validate for that?
I guess my validation is picking up on the @ symbol and the fact that some chars are needed before and after the @ symbol and a dot exists. But can we validate this further to prevent me getting this kind of email?
Could someone please tell me what is going on here. If I hard code a username and password, the script works fine, but when I set the user name and password with a reqeust.form, I always get the invalid user notice. Then after getting that a couple of times, even hard coding the user name and password will cause the script to fail.
The error number it gives is 424.
<%@ Language = VBScript %> <% option explicit %> <% dim UserName, Pswd, oADsObject, strADsPath, oADsNamespace on error resume next
Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, UserName, Pswd, 1)
if not (Err.number = 0) then response.write "Invalid Username or Password!" else response.write "Access Granted." end if set oADsObject = nothing set oADsNamespace = nothing
I need some simple validation that will return an error page if value which isnt contained within the database is entered.
ie. if a user enter's 1234 and it isnt entered in the databse they will be taken to an error page.
Im not sure on how to construct the code. It needs to look at the databse and match the value entered in the form with a value in the database. If the value doesnt exist it should go to the error page.
if ((form1.Decline.value=='') && (form1.OfficeStatus == "YES") & (form1.FloorBldgDiscStat.value=='')) { alert('Enter value on floorbldgstat') return (false); }
This validation does not work when i try to update my asp page i should prompt the alert msg. My OfficeStatus field is a dropdown with value of "YES" and "NO". What i should i use to get the value "YES" i javascript. Single equal sign(=) or double equal sign (==), and anothe one is what should i use in enclosing the "YES" value. '' or "".
Create the following code from database but does not validate on enter - I am using ShadowWizards validation code.
<Input fields so work however I will need dropdown and radio buttons to be validated also.
I really like the work ShadowWizard has put in and would like to continue in the same neat, cleaver coded way!
I did validate the few fields with ASP but Yahoo toolbar stops people going back on forms and therefor would not work on all PC's, typically the bosses and now he seems to want it asap so any javascript solution? Code:
I am not getting the url in email that I want to receive after a user completes a job application form. The url is in bold and red. Is there something wrong in my code ? To clarify here is my code:
I would like to know if it's possible to have the browser email me everytime a end user encounters an error on my page. i would also like that email to include the error message.
I am trying to figure out how to send email with asp. I have the smtp stuff installed and configured it for localhost. My code is as follows. I get an unspecified errorr that points to the line which sends the email. That line is marked in bold. Code:
Is it possible to redirect the server to another ASP page if the requested page throws an error? I want to redirect the user to a custom error page and then send the webmaster an email that contains the error message.
I'm getting the following error with GoDaddy.com, but customer support tells me I have the correct SMTP address. They can't help me until I've proven the error is on their side.
I've used this code on other hosts, and it works just fine.
i have a script that allows user to register and then it is supposed to send an email for them to complete registration, the process of registration works ( the data can be seen in the database ) but it errors on submit when it tries to send an email out
I can go into the database and change the confirmed field to yes and that allows the user to log in but they cant get the email or login with this error pending - Code:
I have a mail script but don't know how to catch any errors so that it will display email address that failed to send. Here is my code...
Dim mail Set mail = Server.CreateObject("CDO.Message") mail.From = "from@mail.com" mail.Bcc = "bcc@mail.com, bcc2@mail.com" mail.To = "to@mail.com" mail.Subject = "This is the subject of the email" mail.HTMLBody = "I am the message that will be displayed in the body" mail.Send() Set mail = Nothing
How can I display a message that says that there's an error with sending the mail?
I am currently having an issue with CDO and my asp code. The email body is including an "!" and space when the body is greater the 600 characters. Does CDO have a limit on the length of the email body. The issue is occuring both in .textbody and .htmlbody formats. Has anyone seen this before? Where do I need to look in order to determine the cause?
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "admin@abc.com"
objMail.Subject = "This is a test"
objMail.To = "webmaster@xyz.com"
objMail.Body = "this is a test email from abc.com"
objMail.Send
Set objMail = nothing
This code works perfectly well from any machine apart from the domain controller. On the domain controller, i get the following access denied error message:
Microsoft VBScript runtime error '800a0046'
Permission denied
/Emailer.asp, line 310
I have given full permission to the drop folder in the mail root as guided in other sites. It's still not working.
Can anyone tell me where i'm going wrong? anything else i can try?