www.webdeveloper.com
Results 1 to 4 of 4

Thread: email form problems, any ideas??

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    8

    Question email form problems, any ideas??

    im new to ASP so tbh i dont really have a clue whats going on. here is my html code:
    Code:
    <form method="POST" action="contactus.aspx">
    <fieldset class="list">
    <p1> Name: <input type="text" name="Name" size="30"/> <br /><br />
    Subject: <input type="text" name="Subject" size="50"/> <br /><br />
    <p1>E-mail Address: <input type="text" name="E-mail Address" size="50"> <br /><br />
    <p1>Tel:<input type="text" name="Tel" size="30"> <br /><br />
    
    Comments:<br /> <textarea name="Comments" rows="10" cols="50" wrap="physical" >
    </textarea><br /><br />
    Please specify what category your comment falls into:
    
    
    
               
    					<br /><br /><label for="topic1">
    						<input id="topic1" name="subject" class="noBorder" value="Brand or product" type="radio">
    						Service you experience whilst at Lloyds Lanes<br />
    					</label>    
               
    					<label for="topic2">
    						<input id="topic2" name="subject" class="noBorder" value="Investor relations" type="radio">
    						Question about our party packages we offer<br />
    					</label>    
               
    					<label for="topic3">
    						<input id="topic3" name="subject" class="noBorder" value="Environment &amp; society " type="radio">
    						Other <br />
    					</label>    
               
    					  
    
    <br /> <input name="submit" value="Submit" type="submit" />
    <input value="Clear" type="reset" />
    </p1></form>
    and here is what ive got in my .aspx page
    Code:
    <% 
    
    ' declare variables
    Dim EmailFrom
    Dim EmailTo
    Dim Subject
    Dim Comments
    
    ' get posted data into variables
        EmailFrom = Trim(Request.Form("EmailFrom"))
        EmailTo = "lloydslanes@googlemail.com"
        Subject = Trim(Request.Form("Subject"))
        Name = Trim(Request.Form("Name"))
        E(-mail Address = Trim(Request.Form("E-mail Address")))
        Tel = Trim(Request.Form("Tel"))
        Comments = Trim(Request.Form("Comments"))
        
    ' validation
    Dim validationOK
    validationOK=true
    If (Trim(EmailFrom)="") Then validationOK=false
        If (validationOK = False) Then Response.Redirect("error.htm" & EmailFrom)
    
    ' prepare email body text
        Dim Comments
        Comments = Comments & "Comments: " & Comments & vbCrLf
    
    ' send email 
    Dim mail
    Set mail = Server.CreateObject("CDONTS.NewMail") 
    mail.To = EmailTo
        mail.From = Name
    mail.Subject = Subject
        mail.Comments = Comments
    mail.Send 
    
    ' redirect to success page 
        Response.Redirect("emailsent.htm" & EmailFrom)
    %>
    please help! I am very confused! Thanks!

  2. #2
    Join Date
    Dec 2007
    Location
    Dayton, OH
    Posts
    390
    what type of error are you getting? I see that you are using CDONTS as your mailing object. CDONTS is very old and not support out of the box by windows 2003 Server and beyond. You might want to look at CDO.message as your mailing object.

  3. #3
    Join Date
    Apr 2009
    Posts
    8
    this is the error message i am getting:

    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


    A name was started with an invalid character. Error processing resource 'file:///C:/Users/Shel/Documents/Uni Work/Year 2/We...

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="contactus.aspx.vb" Inherits="_Default" %>
    -^

    oh ok for the mailing object shall i litterally just change my ("CDONTS.NewMail") for ("CDO.message")?? sorry, but i really dont know asp at all, this is my first time using it lol.

  4. #4
    Join Date
    Dec 2007
    Location
    Dayton, OH
    Posts
    390
    .aspx files are related to .NET. You might want to ask this question in the .NET forums. I'm not sure anyone will be able to help you here.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles