har nu fået lavet formularen og koden, jvf flg:
http://alanexcel.dk/demo_email_down.asp og koden der skulle sende filen:
<%@LANGUAGE=\"VBSCRIPT\" %>
<%
\' Create the JMail message Object
set msg = Server.CreateOBject( \"JMail.Message\" )
Set upload = Server.CreateObject( \"w3.Upload\" )
\' Check for attachments and add them to the email
set attachment = upload.Form( \"attachment\" )
if attachment.IsFile then
msg.AddCustomAttachment attachment.filename, attachment.item, false
end if
\' Set logging to true to ease any potential debugging
\' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true
\' Get the form variables, using the upload object
Name = upload.Form(\"name\")
SenderEmail = upload.Form(\"email\")
Subject = \"Regarding \" & upload.Form (\"subject\")
Recipient = upload.Form(\"recipient\")
Body = upload.Form(\"body\")
\' And apply them to the message
msg.From = SenderEmail
msg.FromName = Name
msg.AddRecipient Recipient
msg.Subject = Subject
msg.Body = Body
\' To capture any errors which might occur, we wrap the call in an IF statement -replaced if not msg.Send( \"mail.myDomain.net\" ) then
if not msg.Send( \"alan@alanexcel.dk\" ) then
Response.write \"<pre>\" & msg.log & \"</pre>\"
else
Response.write \"Message sent succesfully!\"
end if
\' And we\'re done! the message has been sent.
%>
Problemet er at dette resulterer i en fejlmeddelelse som flg:
Server object error \'ASP 0177 : 800401f3\'
Server.CreateObject Failed
/JmailUploadProcess.asp, line 70 (koden fylder kun 58 linier)
Hvad gør en \"klog\" nu
mvh
alj