Results 1 to 2 of 2

Thread: Form Needs to Allow Attachments

  1. #1
    Join Date
    Aug 2010
    Location
    Jacksonville, FL
    Posts
    77
    Thanks
    29
    Thanked 0 Times in 0 Posts

    Default Form Needs to Allow Attachments

    Hello,

    I have a form which needs to allow for attachments. Our server is strictly Microsoft products and will not support PHP.

    [URL] http://jpl.coj.net/webposting.html
    [URL] http://jpl.coj.net/webpostinghandler.asp

    Thank you for any help.

    asp code

    Code:
    <h3>Thank you!</h3>
    <div class="webform">                 
                                                    
    <%
    Dim MsgBody, TargetEmail, TargetSubject
    
        TargetDept = "Technical Support"
        TargetEmail = "eckersen@coj.net"
        TargetSubject = "Request for website posting"
        MsgBody = "The following question was received from " & Request.Form("SubmittedBy")
        MsgBody = MsgBody & vbCRLF & vbCRLF
        MsgBody = MsgBody & "~~Is your request for posting to: " & Request.Form("site") & vbCRLF  & vbCRLF
        MsgBody = MsgBody & "~~Do you have a flier(s) or image you need posted?: " & Request.Form("scope") & vbCRLF  & vbCRLF                 
        MsgBody = MsgBody & "~~Date of Request: " & Request.Form("daterequest") & vbCRLF & vbCRLF
        MsgBody = MsgBody & "~~Date Needed: " & Request.Form("needed") & vbCRLF & vbCRLF
        MsgBody = MsgBody & "~~Contact Name: " & Request.Form("SubmittedBy") & vbCRLF & vbCRLF         
        MsgBody = MsgBody & "~~E-mail: " & Request.Form("email") & vbCRLF & vbCRLF        
        MsgBody = MsgBody & "~~Phone: " & Request.Form("phone") & vbCRLF & vbCRLF      
        MsgBody = MsgBody & "~~Requests: " & Request.Form("other") & vbCRLF & vbCRLF
        MsgBody = MsgBody & "~~Display Dates: " & Request.Form("length") & vbCRLF & vbCRLF 
        MsgBody = MsgBody & "~~Title of Program: " & Request.Form("title") & vbCRLF & vbCRLF
        MsgBody = MsgBody & "~~Date of Program: " & Request.Form("date") & vbCRLF & vbCRLF
        MsgBody = MsgBody & "~~Location: " & Request.Form("location") & vbCRLF & vbCRLF
                    
    %>
    
    <p><strong>Recap of submission:</strong></p>
    <p><strong>Subject:</strong></p> <% Response.Write(TargetSubject) %> 
    <p><strong>Department:</strong></p> <% Response.Write(TargetDept) %> 
    <p><strong>Your Message:</strong></p> <% Response.Write(MsgBody) %>
    
    <%
    
    Set objEmail = CreateObject("CDO.Message")
                    objEmail.From = "website@jpl.coj.net"
                    objEmail.To = TargetEmail
                    objEmail.Subject = TargetSubject
                    objEmail.Textbody = MsgBody    
                    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
                    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
            "smtp.coj.net" 
                    objEmail.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
                    objEmail.Configuration.Fields.Update  
                    objEmail.Send  
    %>          
    
    </div>
    
    <p class="clear_both"></p>
    Last edited by Elbee; 01-15-2012 at 12:41 AM. Reason: to add asp code

  2. #2
    Join Date
    Feb 2011
    Posts
    16
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    use

    objEmail.AddAttachment strFileName

    where strFileName is the physical path name to a file on the server.

    users will need to upload their files to the server if they don't already exist there.

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
  •