Fejl i asp kode
Hej..Jeg har et script som gør at jeg kan vedhæfte en fil til en jmail besked..
Men den kommer med en fejl:
Object doesn't support this property or method: 'IsFile'
Her er koden:
<%@LANGUAGE="VBSCRIPT" %>
<HTML>
<BODY>
<%
' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )
Set upload = Server.CreateObject( "aspSmartUpload.SmartUpload" )
' Check for attachments and add them to the email
set attachment = upload.Form( "attachment" )
if attachment.IsFile then <-- HER SKER FEJLEN
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 = session("user")
SenderEmail = session("email")
Subject = upload.Form ("subject")
Recipient = request.querystring("email")
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
if not msg.Send( "smtp.unoeuro.com" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
%>
<script type="text/javascript">
alert('Din besked er nu blevet sendt!');
</script>
<%
Response.rediect "contact-frame.asp"
end if
' And we're done! the message has been sent.
%>
</BODY>
</HTML>
Nogen der har et bud?
