SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2006
    Location
    Edinburgh, Scotland
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP feedback form issue

    Hi there

    I created a simple form whch however does not seem to work, I keep reading the code and can not see anything wrong - when I submit the form the form reappear blank on my window, instead of confirming that the email was sent ( which is not ! ).
    I would appreciate if someone couls have a look..you eill find the code below.
    ( the "to address" is taken form the form objMail.To = strEmail )

    thanks

    chris
    =======================

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <% Option Explicit %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>test</title>
    </head>
    <body>
    <%
    Dim strName, strEmail, strQuery
    strName = Trim(Request.Form("ClientName"))
    strEmail = Trim(Request.Form("ClientEmail"))
    strQuery = Trim(Request.Form("ClientQry"))

    If (strName <> "" And strEmail <>"" And strQuery <>"") Then
    Dim objMail, aRecipients
    Set objMail = Server.CreateObject("CDONTS.NewMail")

    objMail.from = "webteam@mysite.com"
    objMail.to = strEmail
    objMail.Subject = "webform" & strName

    aRecipients = Array("chris@mysite.com","nico@mysite.com")

    objMail.BCC = join(aRecipients,";")
    objMail.Body = strQuery
    objMail.Send

    Response.write("Thank you for submitting the form")

    set objMail = Nothing

    Else %>

    <form action="<%= Request.serverVariables("Script_Name") %>" method="post" enctype="text/plain">

    <table border=0>
    <tr>
    <td>Name</td>
    <td><input type="text" name="ClientName" value="" size="40"/></td>
    </tr>

    <tr>
    <td>Email address</td>
    <td><input type="text" name="ClientEmail" value="" size="40"/></td>
    </tr>

    <tr>
    <td>Query </td>
    <td><textarea name="ClientQry" cols=40 rows=10></textarea></td>
    </tr>

    <tr>
    <td><input type="submit" value="submit" /> </td>
    <td></td>
    </tr>

    </table>
    </form>

    <% End if %>

    </body>
    </html>

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2006
    Location
    Edinburgh, Scotland
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mmh ! looks like my issue does't inspire anyone

  3. #3
    SitePoint Enthusiast rusagar's Avatar
    Join Date
    Jan 2007
    Location
    Kathmandu, Nepal
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check the code below -

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <% Option Explicit %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>test</title>
    </head>
    <body>
    <%
    if request.form("submit") <> "" then
    Dim strName, strEmail, strQuery
    strName = Trim(Request.Form("ClientName"))
    strEmail = Trim(Request.Form("ClientEmail"))
    strQuery = Trim(Request.Form("ClientQry"))

    If (strName <> "" And strEmail <>"" And strQuery <>"") Then
    Dim objMail, aRecipients
    Set objMail = Server.CreateObject("CDONTS.NewMail")

    objMail.from = "webteam@mysite.com"
    objMail.to = strEmail
    objMail.Subject = "webform" & strName

    aRecipients = Array("chris@mysite.com","nico@mysite.com")

    objMail.BCC = join(aRecipients,";")
    objMail.Body = strQuery
    objMail.Send

    Response.write("Thank you for submitting the form")

    set objMail = Nothing
    else
    response.write "Pleae, enter all the fields"
    end if

    Else %>

    <form action="" method="post" enctype="text/plain">

    <table border=0>
    <tr>
    <td>Name</td>
    <td><input type="text" name="ClientName" value="" size="40"/></td>
    </tr>

    <tr>
    <td>Email address</td>
    <td><input type="text" name="ClientEmail" value="" size="40"/></td>
    </tr>

    <tr>
    <td>Query </td>
    <td><textarea name="ClientQry" cols=40 rows=10></textarea></td>
    </tr>

    <tr>
    <td><input type="submit" value="submit" /> </td>
    <td></td>
    </tr>

    </table>
    </form>
    <%end if%>
    </body>
    </html>

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2006
    Location
    Edinburgh, Scotland
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Rusagar, but I still have the issue.. Does this code actually work when uploaded on your server ?

    ( If that was the case, this would mean that i'll have to check the smtp settings on mine.)

    Can you confirm please ?


Bookmarks

Posting Permissions

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