Jmail & W3 Upload...

Discussion in 'ASP General' started by BDKiii, Jan 12, 2004.

  1. BDKiii

    BDKiii Guest

    Ok.. I know this has been covered before -but- here it is again...
    I installed Jmail to my server and tested it... and it worked fine.
    I then installed W#.Upload to the same server and tested it to attach
    a document or image file from a users PC and attach it to the email on
    the fly.

    I used the following 3 files to do this (attach1.htm, attach2.asp, &
    attach3.htm)

    I receive the text data via email... but no attachment... am I missing
    something here? Any help would be greatly appreciated.

    *****************
    ** attach1.htm **
    *****************
    <html>
    <head>
    <title>Send Mail</title>

    </head>

    <body bgcolor="#FFFFFF">
    <form action="attach2.asp" method="POST"
    enctype="multipart/form-data">
    <div align="left">
    <input type="hidden" name="recipient"
    value="">
    <input type="hidden"
    name="redirect" value="attach3.htm">
    <input type="hidden" name="subject"
    value="Web Site Submission">
    <table border="0"
    cellspacing="0" cellpadding="5" align="center">
    <tr>
    <td align="right"><font size="1"><small><font
    face="Verdana">Name</font></small></font></td>
    <td align="left">
    <input type="text" name="name" size="30">
    </td>
    </tr>
    <tr>
    <td align="right"><font size="1"><small><font
    face="Verdana">Address</font></small></font></td>
    <td align="left">
    <textarea rows="2" name="address" cols="25"></textarea>
    </td>
    </tr>
    <tr>
    <td align="right"><font size="1"><small><font
    face="Verdana">Email Address</font></small></font></td>
    <td align="left">
    <input type="text" name="sender" size="30">
    </td>
    </tr>
    <tr>
    <td align="right"><font face="Verdana"
    size="1"><small>Comment</small></font></td>
    <td align="left">
    <input type="text" name="comment" size="30">
    </td>
    </tr>
    <tr>
    <td align="right"><font face="Verdana"
    size="1"><small>Attachment</small></font></td>
    <td align="left">
    <input name="attachment" type="file" size="30"></td>
    </tr>
    </table>
    <p align="center">
    <input type="submit" name="Submit" value="Submit">
    </p>
    </div>
    </form>
    </body>
    </html>

    *****************
    ** attach2.asp **
    *****************
    <%
    on error resume next
    Set JMail = Server.CreateObject("JMail.SMTPMail")
    Set upload = Server.CreateObject( "w3.Upload" )
    JMail.ServerAddress = "mail.housewall.com"

    ' you can repeat this if you have more than one file,
    ' or you can utilise part of the simple mail script
    if upload.form("attachment").isFile then
    set attachment = upload.Form("attachment")
    JMail.AddCustomAttachment attachment.filename, attachment.item
    end if

    JMail.Sender = upload.form("sender")
    JMail.Subject = upload.form("subject")
    JMail.AddRecipient upload.form("recipient")
    JMail.Priority = 3
    JMail.body = "Your Online Information Request Form Has Been Completed
    With The Following Info:" & vbcrlf
    JMail.appendtext "----------------------------------------------------------------------"
    & vbcrlf
    JMail.appendtext "Name: " & upload.form("name") & vbcrlf
    JMail.appendtext "Address: " & upload.form("address") & vbcrlf
    JMail.appendtext "Email Address: " & upload.form("sender") & vbcrlf
    JMail.appendtext "Comments: " & upload.form("comment") & vbcrlf
    JMail.execute
    response.redirect upload.form("redirect")
    %>


    *****************
    ** attach3.htm **
    *****************
    <html>
    <head>
    <title>Mail Sent</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <meta http-equiv="pragma" content="no-cache">
    <meta name="expires" content="now">
    <meta name="author" content="Justin Reid">
    <meta name="author" content="SCS Technology Solutions Limited">
    <meta name="author" content="http://www.scstechsolutions.co.uk">
    </head>

    <body bgcolor="#FFFFFF">
    <div align="center">
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p><font face="Verdana, Arial, Helvetica, sans-serif">Thank You<br>
    Your e-mail has been sent</font></p>
    </div>
    </body>
    </html>
    BDKiii, Jan 12, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron
    Replies:
    2
    Views:
    445
    Showjumper
    Jun 30, 2003
  2. Ingrid

    asp.net and Jmail

    Ingrid, Oct 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    424
    Ingrid
    Oct 28, 2003
  3. Preston Crawford
    Replies:
    0
    Views:
    416
    Preston Crawford
    Feb 4, 2004
  4. =?Utf-8?B?cm91cm91?=

    How to use Jmail in c# web application

    =?Utf-8?B?cm91cm91?=, Mar 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,577
    Kevin Spencer
    Mar 5, 2004
  5. Vix
    Replies:
    1
    Views:
    3,401
    Thomas Weidenfeller
    Jan 26, 2005
Loading...

Share This Page