Results 1 to 2 of 2

Thread: smtp script help for a formtomail

  1. #1
    Join Date
    Mar 2011
    Posts
    1

    smtp script help for a formtomail

    pls can you help soooooo appreciate this.... script as follows. basically i would like users to be able to submit the form >straight to my email. users do not have email accounts, hence form to mail, and not mailto (as i understand) and have confirmed that the server is working fine...thanks again.....
    <form action="formtomail.asp" method="post">
    <table>
    <tbody>
    <tr>
    <td><font face="Arial" color="#0000ff"><strong>UserName</strong></font></td>
    <td><input maxlength="100" name="UserName">&nbsp; </td></tr>
    <tr>
    <td><font face="Arial" color="#0000ff"><strong>Contract</strong></font></td>
    <td><input maxlength="100" name="Contract">&nbsp; </td></tr>
    <tr>
    <td>
    <p align="center"><font face="Arial"
    color=#0000ff><strong>Query</strong></font></p></td>
    <td><textarea name="comments" rows="10" cols="50"></textarea> </td></tr>
    <tr>
    <td></td>
    <td><input type="submit" value="Submit">
    </td></tr></tbody></table></form></font></a><%
    For Each x In Request.Form
    message = message & x & ": " & Request.Form(x) & CHR(10)
    Next
    set smtp=Server.CreateObject("ASPMAIL.smtp")
    smtp.Server="xxxxxxxxxxxxxxxcapita.co.uk"
    smtp.Rcpt="xxxxxxxxxxxxxxxxx@capita.co.uk"

    smtp.FromName="Username"
    smtp.Subject="Eptica Query"
    smtp.Message = message
    on error resume next
    smtp.Send
    if err then
    response.Write err.Description
    else
    Response.redirect ("http:// redirect.com")
    end if
    set smtp = Nothing
    %>
    <p></p></h1>
    <h1></h1></h1></body></html>

  2. #2
    Join Date
    Mar 2011
    Location
    Swansea
    Posts
    54
    Hi,

    You may find this tutorial helps http://www.tizag.com/aspTutorial/aspFormsEmail.php . It does it a bit differently, e.g. using a separate file to process the form, but it should help. If it doesn't let me know and I can try help you out.

    Regards

    Adam

Similar Threads

  1. Need help with setting up Google SMTP?
    By Reaper2794 in forum General Questions
    Replies: 0
    Last Post: 12 Sep 2010, 10:27 AM
  2. SMTP alerts - help!
    By Xhi in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 01 Sep 2009, 01:40 AM
  3. smtp trouble
    By Compumaniac12 in forum Web Hosting and Domain Names
    Replies: 1
    Last Post: 26 Aug 2006, 07:10 AM

Posting Permissions

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