A little asp help please

Soldato
Joined
15 Feb 2003
Posts
10,172
Location
Europe
I have a simple form to request a catalogue. The code is:

Code:
 <form action="sendmail.asp" method="post" name="form" id="form">
            <p>
              <input name="from" type="hidden" id="from" value="[email protected]" />
              <br />
              <input name="to" type="hidden" id="to" value="[email protected]" />
              <br />
              Pick a catalogue<br />
              <select name="subject" id="subject">
                <option value="Timber Range">Timber Range</option>
                <option value="Plastic Range">Plastic Range</option>
                <option value="Gymkhana Range">Gymkhana Range</option>
                <option value="Dressage &amp; Arena Equipment">Dressage and Arena Equipment</option>
                <option value="Pro-Jump Cross Country">Pro-Jump Cross Country</option>
                <option value="All">All</option>
              </select>   
              <br />
              <br />
              Name and Address:<br />
              <textarea name="content" cols="50" rows="8" id="content"></textarea>
              <br />
              <br />
              Email Address:<br />
              <textarea name="content" cols="50" rows="1" id="content"></textarea>
            </p>
            <p>Telephone:
              <br />              
              <textarea name="content" cols="50" rows="1" id="content"></textarea>              
                  <br />
                  <br />
                  <input type="submit" name="Submit" value="Submit" />
              </p>
            </form>


The sendmail.asp file contains the following, that sends the client (well me for testing) an email.


Code:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="mail.classicshowjumps.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25 
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>

Now this is all well and good but I want the form subject, content, email etc.. to be sent to me in that e-mail. At the moment i jsut get an email with the text "this is a message", as that is what is in sendmail.asp

I do not know any asp coding at all.

Can anyone tell me how to have smailmail.asp pull the content from the completed form?

I have tired the lines:
MailSubject = Request.Form("subject")
MailContent = Request.Form("content")

but this is from an older asp mailer and causes an Internal 500 error.

I am on an ISS7 server if that makes an difference.

Thanks
 
replace
myMail.Subject="Sending email with CDO"
with
myMail.Subject=Request.Form("subject")

and
myMail.TextBody="This is a message."
with
myMail.TextBody=Request.Form("content")

?
 
Back
Top Bottom