Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Estou com um código para envio de email com anexo, mas quando eu coloco pra rodar ele mostra o seguinte erro:
"Objeto Server erro 'ASP 0177 : 800401f3'
Falha em Server.CreateObject
/design/form/cod_asp.asp, line 24
800401f3 "
Segue abaixo o código:
<%' formmail.asp by Duane Jackson 30/11/2004 duane[at]keyone.co.uk''Put a form on your webpage with the action set to point to this file and the method set to POST'The form should contain two hidden fields. The first should be called 'subject' and contain the value'hat you wish to appear in the email subject line. The second should be called 'redir' and the value'should contain the URL you want to redirect the user to once the email has been sent. This may be a thanks page.''Finally, edit the details below to set the sender and recipient details, and the text you want to use as'an introduction to the email. Change continueOnErrors to 'true' if you want any errors to be ignored. sSenderAddress = "teste@teste.com" sSenderName = "FormMail" sRecipientName = "Teste " sRecipientAddress="meuemail@terra.com.br" sIntroText = "The details below were sent via your website:" continueOnErrors = false sSavePath = "d:\web\localuser\user\www\site\form"' Thats all! Don't edit below this line unless you know what you are doing. if continueOnErrors then on error resume next Dim mySmartMail Set mySmartMail = Server.CreateObject("Persits.mySmartMail") mySmartMail.Server = "smtp-web.kinghost.net" mySmartMail.SenderName = sSenderName mySmartMail.SenderAddress = sSenderAddress mySmartMail.Recipients.Add sRecipientAddress, sRecipientName Set Upload = Server.CreateObject("Persits.cUpload") sRedir = upload.Form("redir").value mySmartMail.Subject = upload.Form("subject").value For i = 1 to upload.count FormItem = upload.form(i).name if lcase(FormItem) <> "redir" AND lcase(FormItem) <> "subject" AND lcase(FormItem) <> "file" AND lcase(FormItem) <> "submit" then sBody = sBody & FormItem & ": " & upload.Form(FormItem).value & vbcrlf Next mySmartMail.Body = sIntroText & vbcrlf & vbcrlf & sBody if upload.fieldExists("file") then bHaveFile = true sFilePath = upload.form("file").value sExt=right(sFilePath,3) sFileName = session.SessionID & "." & sExt upload.Form("file").SaveFile sSavePath, sFileName mySmartMail.Attachments.Add sSavePath & "\" & sFileName end if mySmartMail.SendMail set mySmartMail = nothing set upload = nothing if bHaveFile then set fso=server.CreateObject("scripting.filesystemobject") fso.deletefile sSavePath & "\" & sFileName set fso = nothing end if response.redirect sRedir %>
Componentes instalados no servidor:
ActiveX Data Object, ASP HTTP, ASP Mail, ASP POP 3, ASP Smart Upload, CDO NTS, Dimac JMail, Dundas Upload, File System Object, Last Mod, Microsoft XML Engine, Persits ASP JPEG, Persits ASPEmail, Persits ASPEncrypt, Persits File Upload, Image Size, Microsoft XML HTTP.
Carregando comentários...