Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: cdosys problems

  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cdosys problems

    i don't know what the prob is with this

    Code:
    <%@LANGUAGE="VBSCRIPT"%>
    <%
    If request.servervariables("CONTENT_LENGTH") <> 0 THEN
    Set objEMail = Server.CreateObject("CDO.Message")
    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Confi = objConfig.Fields
    Confi("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    Confi("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"
    Confi.Update
    Set objEMail.Configuration = objConfig
    objEMail.To = "someone@mail.com" 'i have inputed a valid address while testing here
    objEMail.From = Request("from")
    objEMail.Subject = Request("subject")
    objEMail.TextBody = Request("message") 
    objEMail.Send
    Set objEMail = Nothing
    
    Response.Write("Message Sent")
    Else
    
    %>
    <html>
    <body>
    <form method="post" action="stupid.asp">
    From Email: <INPUT type=text name="from"><br />
    Subject: <INPUT type=text name="subject"><br />
    Message: <TEXTAREA name="message" rows=10 cols=40></TEXTAREA><br />
    <INPUT type="submit" value="Send" name="submit">
    </form>
    </body>
    </html>
    <% 
    End If
    %>
    the mail never gets delivered. this is copied straight from a tutorial

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    try this instead

    Code:
    <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" -->
    <%
    on error resume next
    If Len(Request.Form("submit")) <> 0 THEN
       Set objEMail = Server.CreateObject("CDO.Message")
       objEMail.To = "someone@mail.com" 'input a valid address here
       objEMail.From = Request.Form("from")
       objEMail.Subject = Request.Form("subject")
       objEMail.TextBody = Request.Form("message") 
       objEMail.Send()
       Set objEMail = Nothing
       
       If err.number = 0 Then  '  only display message sent if there is no error
          Response.Write("Message Sent")
       End If
    Else
    
    %>
    <html>
    <body>
    <form method="post" action="stupid.asp">
    From Email: <INPUT type=text name="from"><br />
    Subject: <INPUT type=text name="subject"><br />
    Message: <TEXTAREA name="message" rows=10 cols=40></TEXTAREA><br />
    <INPUT type="submit" value="Send" name="submit">
    </form>
    </body>
    </html>
    <% 
    End If
    %>
    Last edited by miranda; 08-12-2004 at 10:51 PM.


  •  

    Posting Permissions

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