Jmail & W3 Upload...

B

BDKiii

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="(e-mail address removed)">
<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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top