Urgent: ASP email script not working?

Associate
Joined
12 Aug 2004
Posts
1,009
Location
Glasgow, Scotland
Hi there,

I've got a form on an asp page on the web and i'm basically trying to email the form contents on submission to my address, but for some reason nothing is coming through?

What happening at the moment is the form is getting submitted and then being sent to the other asp page, where the text "Thanks, your enquiry has been sent and we will get back to you shortly" is getting written, but i've waited for hours and no emails appear to be coming through at all :( I've included the code below, but from what i can tell everything seems to be ok? Maybe its something to do with my postmaster email on the hosting side.

Any ideas anyone? Its kind of urgent!

Cheers for any help given :) :)

Form:
Code:
<form action="index.asp?pg=11" method="post">

<div align="left">

	<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">

		<tr>
			<td width="18%" align="left" valign="top">Your Name:</td>
			<td width="82%" align="left" valign="top"><input size="40" name="fullName"></td>
		</tr>

		<tr>
			<td width="18%" align="left" valign="top"> Your Email:</td>
			<td width="82%" align="left" valign="top"><input type="text" size="40" name="email"></td>
		</tr>

		<tr>
			<td width="18%" align="left" valign="top">Your Country:</td>
			<td width="82%" align="left" valign="top"><input type="text" name="country" size="20"></td>
		</tr>

		<tr>
			<td width="18%" align="left" valign="top">Party Size:</td>
			<td width="82%" align="left" valign="top"><input type="text" name="partySize" size="20"></td>
		</tr>

		<tr>
			<td width="18%" align="left" valign="top">Arrival Date:</td>
			<td width="82%" align="left" valign="top"><input type="text" name="arrivalDate" size="20"><em><font size="1">( Day / Month / Year )</font></em></td>
		</tr>

		<tr>
			<td width="18%" align="left" valign="top">Departure Date:</td>
			<td width="82%" align="left" valign="top"><input type="text" name="departureDate" size="20"><em><font size="1">( Day / Month / Year )</font></em></td>
		</tr>
	</table>
</div>

<br />

<div align="left">
	<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
		<tr>
			<td width="100%" align="left" valign="top"><b>Please type any questions in the area below</b></td>
		</tr>

		<tr>
			<td width="100%" align="left" valign="top"><textarea name="comments" rows="6" cols="40"></textarea></td>
		</tr>

		<tr>
			<td width="100%" align="left" valign="top"><input type="submit" value="Submit" name="Submit"> <input id="Clear" type="reset" value="Clear" name="Clear"></td>
		</tr>
	</table>
</div>

</form>

ASP Email Script:
Code:
<%
	fullName = Request.QueryString("fullName")
	email = Request.QueryString("email")
	country = Request.QueryString("country")
	partySize = Request.QueryString("partySize")
	arrivalDate = Request.QueryString("arrivalDate")
	departureDate = Request.QueryString("departureDate")
	comments = Request.QueryString("comments")

	varBody = fullName & vbCtrLf & email & vbCtrLf & country & vbCrLf & partySize & vbCrLf & arrivalDate & vbCrLf & departureDate & vbCrLf & comments

	Set ObjMail = Server.CreateObject("CDONTS.NewMail")
	objMail.From = fullName & " <" & email & ">"
	objMail.To = "[email protected]"
	objMail.Subject = "Enquiry from PinesVilla.com"
	objMail.Body = varBody
	objMail.Send
	Set objMail = Nothing

	Response.Write "Thanks, your enquiry has been sent and we will get back to you shortly"
%>
 
The SMTP Server on IIS needs to be set up as a stand-alone mail server, or act as a relay to another server.
 
Hi there, firstly thanks for replying :)

I'm not to sure what you mean by the IIS SMTP server? I've gone into my domains control panel and looked at the mailbox settings but i'm just not sure what i'm looking for :confused:

Is there anyway you could explain in more detail?

Thanks :)
 
I've been doing a bit of reading i'm getting the idea i basically don't have CDONTS, or a form of sending email on my asp server?

If this is right, could someone explain how I go about installing it?

Thanks :)
 
Ok...

I've been reading into this even further and came across this site.

For installing this on my server would I have to copy those 2 peices of text into the files with the appropriate names and then save them into my root directory, or somewhere within it :confused:

Come on people, lend a fellow OcUKer a hand!
 
Back
Top Bottom