Reply to topic
Another ASP Mail Form question
clintribble


Joined: 22 Apr 2008
Posts: 2
Reply with quote
I have a site that uses the code from here: http://www.hostmysite.com/support/programming/aspmail/

The code works. If I browse to the page directly I get an empty e-mail. When I fill out my form and hit submit, the page does nothing. Here's the code on the form page ( http://www.ribblegroup.com/ribblegroup_contactus.aspx ) :

Code:
 <form action="aspmailform.asp" method="post">

    <table border="0" cellspacing="1" cellpadding="1" style="width: 60%">
      <tr>
        <th scope="row" style="width: 84px">Your Name </th>
        <td style="width: 171px">
        <input name="name" type="text" id="name" size="30" maxlength="50" /></td>
      </tr>
      <tr>
        <th scope="row" style="width: 84px">E-mail Address </th>
        <td style="width: 171px">
        <input name="email" type="text" id="email" size="30" maxlength="60" /></td>
      </tr>
      <tr>
        <th scope="row" style="width: 84px">Phone Number </th>
        <td style="width: 171px">
        <input name="phone" type="text" id="phone" size="15" maxlength="12" style="width: 186px" /></td>
      </tr>
      <tr>
        <th scope="row" style="width: 84px">Message</th>
        <td style="width: 171px">
      <textarea name="message" cols="50" id="message" style="height: 119px"></textarea></td>
      </tr>
      <tr>
        <th scope="row" style="width: 84px">&nbsp;</th>
        <td style="width: 171px">
        <input type="submit" name="Submit" value="Submit" id="Submit" /></td>
      </tr>

    </table>
  </form>


here's the code from the aspmailform.asp page ( http://www.ribblegroup.com/aspmailform.asp )

Code:
 <%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "website"
Mailer.FromAddress= "user@ribblegroup.com"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "Clint", "clintribble@gmail.com"
Mailer.AddExtraHeader "X-MimeOLE:Produced yourdomain.com"
Mailer.Subject = "Form Submission"

strMsgHeader = "Form information follows" & vbCrLf
for each qryItem in Request.Form
  strMsgInfo = strMsgInfo & qryItem & " - " & request.Form(qryItem) & vbCrLf
next
strMsgFooter = vbCrLf & "End of form information"

Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter
if Mailer.SendMail then
  Response.Write "Form information submitted..."
else
  Response.Write "Mail send failure. Error was " & Mailer.Response
end if
set Mailer = Nothing
%>


but I don't think the aspmail page is the problem. for whatever reason, hitting submit does nothing but appear to "reload" the form page.

Any help would be greatly appreciated.
dmalone
HostMySite Tech

Joined: 23 Nov 2004
Posts: 42
Reply with quote
Hi there,

Sorry for the delay in someone seeing your post. I took a look at the source on http://www.ribblegroup.com/ribblegroup_contactus.aspx and one thing that stuck out is that your aspmail form is contained in another main form that wraps the whole page, the one that begins with:

Code:
<form name="aspnetForm" method="post" action="ribblegroup_contactus.aspx" id="aspnetForm">


Maybe this is handling the post instead? I am not a .NET expert but that is where I would start!


Take care,
Dave
asp email problem solved
clintribble


Joined: 22 Apr 2008
Posts: 2
Reply with quote
That was the problem. I'll explain why it happened, just in case someone else has the same issue.

Using Microsoft Expression Web to create an ASPX page automatically inserts a form tag. I was using a Master Pages instead of dwt pages (which, as a coldfusion guy, I'm really starting to like the concept of). Those master pages defaulted to haveing a "form" nested right inside the main body tag as well. Thus, all of my pages were contained within forms.

Thanks for catching that!
Clint
dmalone
HostMySite Tech

Joined: 23 Nov 2004
Posts: 42
Reply with quote
Hey Clint,

Glad that helped! Happy developing!


-Dave
Another ASP Mail Form question
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic