473,473 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Contact us form using ASP in Dreamweaver

1 New Member
I have buit a website using a template and want to use a contact form for people to submit details which the sends it to my email. My server is set for ASP. Below is the code can with my 2 email addresses.

Can anyone tell me why i am still getting a invalid email address message.

Thanks

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("admin@ianantony.co.uk")
myMail.To = Request.QueryString("info@ianantony.co.uk")
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>
Nov 19 '06 #1
2 2520
AricC
1,892 Recognized Expert Top Contributor
Try this regular expression:

Expand|Select|Wrap|Line Numbers
  1. "^[\w~'\-\.]+@[\w\-\.]{2,}\.[a-zA-Z\d]{2,4}$"
Nov 21 '06 #2
AricC
1,892 Recognized Expert Top Contributor
Also, just wondering in your myMail.From & myMail.To fields [font=Verdana][size=2]if you are requestiong those values from the query string constantly why even bother putting them in the query string? You could just set them equal to strings? Not that it really matters where they come from.[/size][/font]
Nov 21 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: toedipper | last post by:
Hello, Not sure if this is an asp or dreamweaver or a.n.other editor problem... I have a form with stacks of fields. This is submitted to a formmail.asp script at my isp which emails the...
1
by: Miguel Orrego | last post by:
Hi, I have a form that is created dynamically from a recordset, this creates a line for each record together with 2 checkboxes, Yes & No so the source output would be something like this: ...
2
by: Scott_From_PA | last post by:
I have a love hate thing going with Dreamweaver! One of the things I absolutely hate is the properties box when modifying form objects. Lets say you lay out a form in a table and it comes time...
20
by: Griff | last post by:
Hi there I'm after some suggestions as to how one might best separate form and content in a normal run-of-the-mill web application. I'm sure whole bookshelves have been written on this, but I...
43
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the...
4
by: thanos | last post by:
Hello, I'm relatively new to PHP so I found this free contact us script on the net that i was going to use for my Contact Us php page. Its works pretty good except for error handling. I was...
1
by: neoseeker191 | last post by:
I'm using Dreamweaver 8 and I want to make a ASP contact form. I've used PHP before but I'm new to ASP. What I want to do is have the user type their email address in a text field on the form, and...
8
by: chromis | last post by:
Hi, I'm writing a contacts section for a cms on a website, I've decided to write the section in OO code. So far I have my Contacts object and a page structure I would use for a procedural site. ...
1
by: valmae | last post by:
Please help anyone! I am getting this error after the submit button is clicked to this form which was designed in Dreamweaver in ASP. Microsoft VBScript compilation error '800a0401' Expected...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.