Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Email with attachment
Old 04-07-2006, 10:18 PM Email with attachment
Average Talker

Posts: 26
Trades: 0
Hi Guys,
Can you please help me to see where I am doing wrong?I am getting this error:

Thanks,
Elham

Dear test,

Thank you for sending your info
This is what we sent via email to :eshafie@hotmail.com
From : test (ellie@stecs.com)
Attached :

CDO.Message.1
error '80040220'
The "SendUsing" configuration value is invalid. /process_form.asp, line 84
----------------------------------------------
<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBS CRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
</head>
<body>
<%
' FROM info : Get the user fields from the page before. As an example I put two fields here : fromName and fromEmail
fromName= request.Form("fromName")
fromEmail= request.Form("fromEmail")
' TO info : Who is this being emailed to goes here
toEmail= "eshafie@hotmail.com"
' SUBJECT info : Whats the email subject?
toSubject= "Here is an email with attachment from "&fromName
' BODY info : What info that user filled in do we want to send?
toHTMLBody= "Hello.<br>" &_
" This is an email from "&fromName&". Here is more info :<Br/>"&_
" Email : "&fromEmail
' ATTACHMENT : What file is being attached?
toAttachment= request.Form("toAttachment")
'LET USER KNOW EMAIL WAS SENT SUCCESSFULY :
aftersuccessfulemail = " Dear "&fromNAme&", <Br><br>"&_
" Thank you for sending your info <br>"&_
" This is what we sent via email to :<b>"&toEmail&"</b><br>"&_
" From : <b>"&fromName&" ("&fromEmail&")</b><br>"&_
" Attached : <b>"&toAttachment&"</b>"


response.write(aftersuccessfulemail)

'BUILD EMAIL : Process the info gathered and send the user an email with attachment and fields

' PROCESS fromEmail
if trim(fromEmail)<>"" and trim(toEmail)<>"" then
Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = fromEmail
MyMail.To = toEmail
end if

' PROCESS toSubject
if trim(toSubject) <>"" then
MyMail.Subject = toSubject
end if
' PROCESS toHTMLBody
if trim(toHTMLBody) <>"" and toTEXTBody ="" then
MyMail.HTMLBody = toHTMLBody
end if
' PROCESS toAttachment
if trim(toAttachment)<>"" then
MyMail.AddAttachment(toAttachment)
end if

' PROCESS ALL
MyMail.Fields.Update()

' SEND email
MyMail.Send()

' RESET everything
Set MyMail = Nothing

%>
</body>
</html>
elham is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-07-2006, 10:25 PM Re: Email with attachment
Average Talker

Posts: 26
Trades: 0
Please disregard the last one here is the code and error:

Error:
-------------

Server object error 'ASP 0177 : 800704ec'
Server.CreateObject Failed
/process_form2.asp, line 29 800704ec

Code:
-----------------------
<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBS CRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
</head>
<body>
<%

' Elham jan this is an updated demo I built to include ASPLOAD object which allows you
' to temporarily upload the file to the server before attaching justa demo of how
' the form is processed with minimal information. This object is something your ISP
' needs to have pre-installed on their server before it can work. Also you will need
' to have access to a directory that is temporary and is writable.


' ASPUPLOAD object is loaded
Set Upload = Server.CreateObject("Persits.Upload")
' UPLOAD MAX SIZE : We use memory uploads, so we must limit file size
Upload.SetMaxSize 1000000, True
' Save to memory. Path parameter is omitted
Upload.Save

' FROM info : Get the user fields from the page before. As an example I put two fields here : fromName and fromEmail
fromName= Upload.Form("fromName")
fromEmail= Upload.Form("fromEmail")
' SET UPLOAD PATH : You need a temporary location to upload the file. This directory needs to have write permissions for this to work
Path = "upload"
' UPLOAD TO PHYSICAL LOCATION : Save files to it. Our form has only one file item
' but this code is generic.
For Each File in Upload.Files
uploadfrom = File.Path
response.write("<hr>")
File.SaveAsVirtual Path & "/" & File.FileName
filepath=File.Path
response.write("File Temporarily Uploaded To : "&filepath)
response.write("<br>")
toAttachment= filepath
Next
response.write("<hr>")

' TO info : Who is this being emailed to goes here
toEmail= "ellie@stecs.com"
' SUBJECT info : Whats the email subject?
toSubject= "Here is an email with attachment from "&fromName
' BODY info : What info that user filled in do we want to send?
toHTMLBody= "Hello.<br>" &_
" This is an email from "&fromName&". Here is more info :<Br/>"&_
" Email : "&fromEmail

'LET USER KNOW EMAIL WAS SENT SUCCESSFULY :
aftersuccessfulemail = " Dear "&fromNAme&", <Br><br>"&_
" Thank you for sending your info <br>"&_
" This is what we sent via email to :<b>"&toEmail&"</b><br>"&_
" From : <b>"&fromName&" ("&fromEmail&")</b><br>"&_
" Attached : <b>"&toAttachment&"</b>"


response.write(aftersuccessfulemail)

'BUILD EMAIL : Process the info gathered and send the user an email with attachment and fields

' PROCESS fromEmail
if trim(fromEmail)<>"" and trim(toEmail)<>"" then
Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = fromEmail
MyMail.To = toEmail
end if

' PROCESS toSubject
if trim(toSubject) <>"" then
MyMail.Subject = toSubject
end if

' PROCESS toHTMLBody
if trim(toHTMLBody) <>"" and toTEXTBody ="" then
MyMail.HTMLBody = toHTMLBody
end if

' PROCESS toAttachment
if trim(toAttachment)<>"" then
MyMail.AddAttachment(toAttachment)
end if

' PROCESS ALL
MyMail.Fields.Update()

' SEND email
MyMail.Send()



' DETLETE UNNEEDED FILE AFTER UPLOADING
Dim myFSO
'this line creates an instance of the File Scripting Object named myFSO
SET myFSO = Server.CreateObject("Scripting.FileSystemObject")
'error handling here to make sure that things go smoothly
'if the file does not exist
If myFSO.FileExists(filepath) Then
'then we delete it
myFSO.DeleteFile(filepath)
response.write("<hr>")
response.write("Temporary file deleted : "&filepath)
Else
'otherwise we tell the client it does so they don't get a nasty error
Response.Write "THIS FILE DOESN'T EXISTS"
End If
'this line destroys the instance of the File Scripting Object named myFSO
SET myFSO = NOTHING

' RESET everything
Set MyMail = Nothing


%>

</body>
</html>
elham is offline
Reply With Quote
View Public Profile
 
Old 04-08-2006, 06:55 AM Re: Email with attachment
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
probably ASPUpload isn't installed on the server

same as in this thread

which is line 29 anyway ???
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Email with attachment
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20437 seconds with 12 queries