ASP - sending an email response

Permabanned
Joined
24 Dec 2002
Posts
474
Location
Chelmsford, Essex. Bling Bling
I want a basic form on my site with just a name and text box for people to send some feedback through email.

Using this...

Code:
<html>
<body>
<form action="Test.asp" method="post">

<h3>This form sends an e-mail.</h3>
Name:<br>
<input type="text" name="fullname" size="20">
<br>
<textarea rows="10" cols="30" name="bodytext">
</textarea>
<br><br>
<input type="submit" value="Submit">
</form>

<%
dim FromName
dim MainText

FromName = Request.form("fullname")
MainText = Request.form("bodytext")

if FromName <> "" Then
	response.write("Hello " & Request.form("fullname") & "<br>")
	response.write(Request.form("bodytext"))

	Set myMail=CreateObject("CDO.Message")
	myMail.Subject="New Email"
	myMail.From= FromName
	myMail.To="[email protected]"
	myMail.TextBody=MainText
	myMail.Send
	set myMail=nothing
end if
%> 


</body>
</html>

This doesnt generate any errors but neither do any emails appear in my inbox.
Anything im missing here? Im assuming my web space providor (Blueyonder) have this CDO component installed as i dont get a error when its fired off. The response.writes are just there to make sure the form controls are being picked up correctly which they are.
 
ah ok didnt think of that :) Ta.

*edit* still no joy. It might be something set up at work here stopping it, will try it at home tongiht and see if it works.
 
Last edited:
ok thanks for all that :)

Ive uploaded the page to my webspace, theres no cgi-bin directory there that i can see so ive just dumped the file into the root of htdocs. This is just the basic Blueyonder personal webspace thing so it might not support email stuff i guess.

When i hit submit i get this error:

----
Error 405 Method Not Allowed
The requested method POST is not allowed for URL /test.asp
----

The link to the page is...
http://www.ashleyc.pwp.blueyonder.co.uk/test.asp
 
ah ok, that would be it. Yeah i had the response.writes working on my own machine at work but due to firewalls and things i couldnt ftp it to my blueyonder site until i got home. Thats a bummer. Have to see if i can get some decent web space off them with all the hassle theyre having with sky at the moment :) Threaten to cancel everything or something.
 
Back
Top Bottom