Advertisement

05.16.2008 at 07:10AM PDT, ID: 23408306
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Can't Attach file via CDONT Email

Asked by lutzsales1953 in Active Server Pages (ASP), Programming for ASP.NET, Scripting Languages

Tags: ,

I've been working to try to get an email to be sent from our website using a file uploader code and the current CDONT code I have. I can get the file to upload, but then I can't get the email to go out with the attachment. This code works fine without the attachment. Please help. Here is the email code:
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
<%response.buffer = TRUE %>
<html>
<head>
	<title>Something here cleaned to protect the innocent</title>
<meta name="description" content=""/>
 
 
<!-- METADATA TYPE="TypeLibrary" FILE="CDONTS.DLL" VERSION="1.2" -->
<!-- #include file="ShadowUploader.asp" -->
 
<%
	nwslttr = request("newsletter")
	qt = "no" 	
	custName 	= request("cname")
	compname 	= request("company_name")
	addr		= request("address")
	cty		   	= request("city")
	stt	   		= request("state")
	zp 	   		= request("zip")
	phn 	   	= request("phone")
	fx    		= request("fax")
	sndr	   	= request("Sender")
    qt      	= request("quote")
	hear		= request("Heard")
	
   if (qt = "yes") then
 	question 	= request("question")
	catalog 	= request("catalog")
    typ 		= request("type")
	size 		= request("size")
	durometer 	= request("durometer")
	quantity 	= request("quantity")
	material 	= request("material")
	up			= request("upload")
   end if
	
%>
<%
'Set objUpload=New ShadowUpload
'If objUpload.FileCount>0 Then
	'Call objUpload.File(0).SaveToDisk(Server.MapPath("Uploads"), "")
'End If
'	Response.Write("file name: "&objUpload.File(x).FileName&"<br />")
'	Response.Write("file type: "&objUpload.File(x).ContentType&"<br />")
'	Response.Write("file size: "&objUpload.File(x).Size&"<br />")
'	Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
'	Response.Write("file saved successfully!")
'	Response.Write("<hr />")
'Next
%>
<!-- Begin Google Analytics Script-->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-74690-1";
urchinTracker();
</script>
<!-- End Google Analytics Script-->
</head>
 
<body>
<%
Set objUpload=New ShadowUpload
If objUpload.FileCount>0 Then
	Call objUpload.File(0).SaveToDisk(Server.MapPath("Uploads"), "")
End If
 
	if (nwslttr <> "") then
		Body = "<html><head><title>Add user to newsletter list</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head>"
		Body = Body & "<body bgcolor='#FFFFFF' text='#000000'><p><font color='#D6D3CE'><b><font color='#660033'>Email: " & nwslttr & "</font></b></font></p>"
		Body = Body & "</body></html>"
		
		Dim Mailer
		Set Mailer = Server.CreateObject("CDONTS.NewMail")
		Mailer.To = "inq@xxxx.com"		
		Mailer.cc = "it@xxxx.com"
		Mailer.From = nwslttr
		Mailer.Subject = "Add this email to mailing list"
		Mailer.Body = nwslttr
		Mailer.Send
		Set Mailer = nothing
		
		response.redirect "thankyou.asp?msg=1"
 
	else 
	
		Body = "<html><head><title>Download catalog</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head><body bgcolor='#FFFFFF' text='#000000'>"
		Body = Body & "<table width='550' border='0' cellpadding='4' cellspacing='0' class='body' style=' border-top: 2 solid #000000; border-left: 2 solid #000000; border-right: 2 solid #000000; border-bottom: 2 solid #000000'>"
		Body = Body & "<tr><td><b>Name:</b></td><td>" & custName & "</td><td><b>Company:</b></td><td>" & compname & "</td></tr>"
		Body = Body & "<tr><td><b>Address: </b></td><td>" & addr & "</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
		Body = Body & "<tr><td><b>city:</b></td><td>" & cty & "</td><td><b>State:</b></td><td>" & stt & "</td></tr>"
		Body = Body & "<tr><td><b>Zip:</b></td><td>" & zp & "</td><td><b>Phone:</b></td><td>" & phn & "</td></tr>"
		Body = Body & "<tr><td><b>Fax:</b></td><td>" & fx & "</td><td><b>Email:</b></td><td>" & sndr & "</td></tr>"
		Body = Body & "<tr><td><b>Heard About Us?</b></td><td>" & hear & "</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
 
		if (qt = "yes") then
		Body = Body & "<tr><td><b>Question:</b></td><td>" & question & "</td><td><b>Catalog?</b></td><td>" & catalog & "</td></tr>"		
		Body = Body & "<tr><td><b>Type:</b></td><td>" & typ & "</td><td><b>Size:</b></td><td>" & size & "</td></tr>"
		Body = Body & "<tr><td><b>Durometer:</b></td><td>" & durometer & "</td><td><b>Quantity:</b></td><td>" & quantity & "</td></tr>"		
		Body = Body & "<tr><td><b>Material:</b></td><td>" & material & "</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
		Body = Body & "<tr><td><b>Print Uploaded:</b></td><td>" & up & "</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
		end if
		
		Body = Body & "</table><br></body></html>"		
		
		Dim sMailer
		Set sMailer = Server.CreateObject("CDONTS.NewMail")
		sMailer.BodyFormat = 0 
		sMailer.MailFormat = 0 
		end if
		
		if qt = "yes" and Trim(objUpload("Get Quote")) <> "" then
		sMailer.To = "inq@xxxx.com"
		sMailer.cc = "it@xxxx.com"
		sMailer.From = sndr
		        If objUpload.FileCount>0 Then
		        sMailer.AttachFile(Server.MapPath("Uploads") & "\" & TRIM (objUpload.File(0).FileName)) 
		        end if
		sMailer.Subject = "Request for quote:"
		else
		sMailer.To = "inq@xxxx.com"
		sMailer.cc = "it@xxxx.com"
		sMailer.cc = "c.laria@xxxx"
		sMailer.From = sndr
		sMailer.Subject = "Catalog has been downloaded by:"
		end if
		
		
		'if (qt = "yes") then sMailer.Subject = "Request for quote:" else sMailer.Subject = "Catalog has been downloaded by:" end if
		
		sMailer.Body = Body
		sMailer.Send
		Set sMailer = nothing
				
		if qt = "yes" then
			if (catalog = "mail") then 
				response.redirect "thankyou.asp?msg=2" 
			end if 
		
			if (catalog = "yes") then 
				response.redirect "thankyou.asp?msg=4"
			end if
		
			if (catalog = "no") then
				response.redirect "thankyou.asp?msg=2" 
			end if
		end if
		
		response.redirect "thankyou.asp?msg=3"
	
%>
</body>
</html>
 
Loading Advertisement...
 
[+][-]05.16.2008 at 07:29AM PDT, ID: 21583037

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 05:37PM PDT, ID: 21594645

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 12:00PM PDT, ID: 21600547

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 01:29PM PDT, ID: 21601284

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Programming for ASP.NET, Scripting Languages
Tags: ASP, CDONT Attachment
Sign Up Now!
Solution Provided By: lutzsales1953
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.19.2008 at 01:31PM PDT, ID: 21601295

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080924-EE-VQP-38 / EE_QW_2_20070628