Results 1 to 3 of 3

Thread: ASP's & e-mail

  1. #1

    Thread Starter
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    Talking

    Can you use ASP's to send like an email response from a web page?

    Por ejemplo:

    Fill in a form on a web site and then email it to a pop account?


    Cheers n beers

    Skeen
    "It wasn't the booze that made me snooze, It was the Gin that did me in!"

  2. #2

    Thread Starter
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    Talking

    If anyones interested, I think this should do the trick:

    <% @Language = "VBSCRIPT" %>
    <% Option Explicit %>
    <% Response.Buffer = True %>
    <% Response.expires = 0%>

    <%
    SUB sendMail( fromWho, toWho, Subject, Body)
    Dim MyMail
    Set MyMail = Server.CreateObject("CDONTS.Newmail")
    MyMail.From = FromWho
    MyMail.To = ToWho
    MyMail.Subject = Subject
    MyMail.Body = Body
    MyMail.Send
    Set MyMail = Nothing
    End Sub

    Dim fromWho
    Dim toWho
    Dim Subject
    Dim Body

    fromWho = TRIM( Request.Form( "FromWho"))
    toWho = TRIM( Request.Form( "ToWho"))
    Subject = TRIM( Request.Form( "Subject"))
    Body = TRIM( Request.Form( "Body"))

    If toWho <> "" Then
    sendMail fromWho, toWho, Subject, Body
    End If

    %>

    <HTML>
    <HEAD><TITLE>Mail Poster</TITLE></HEAD>
    <BODY>
    <FORM action="<%=Request.ServerVariables("SCRIPT_NAME")%>" method="post">
    To : <INPUT NAME="ToWho" TYPE="text" SIZE=40><BR>
    >From : <INPUT NAME="FromWho" TYPE="text" SIZE=40><BR>
    SUBJECT : <INPUT NAME="Subject" TYPE="text" SIZE=40><BR>
    <TEXTAREA NAME="Body" COLS=40 ROWS=5></TEXTAREA><BR>
    <INPUT TYPE="submit" VALUE="SendMail"
    </FORM>
    </BODY>
    </HTML>
    "It wasn't the booze that made me snooze, It was the Gin that did me in!"

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Posts
    87
    Yea cool...

    but where could i find web servers that support CDONTS COM. Any idea guys. I prefer the free ones please??

Posting Permissions

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



Click Here to Expand Forum to Full Width