Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal
Tenho que implementar um formulário de email com anexo com o componente SMARTASPUPLOAD, mas o arquivo, apesar de ser carregado para o servidor, ele não anexa na mensagem. Eu comentei a linha de enviar o anexo e funciona sem enviar, porém quando eu descomento o código dá erro de servidor e não funciona nada... abaixo vai o código da página:
<html><head></head><body><form action="upload.asp" method="post" enctype="multipart/form-data" name="contato" id="contato"> <table width="500" border="0" cellpadding="0" cellspacing="5"> <tr> <td><p>Nome:</p></td> <td colspan="2"><input name="nome" type="text" id="nome" size="50" /></td> </tr> <tr> <td><p>Tel:</p></td> <td colspan="2"><input name="telefone" type="text" id="telefone" size="50" /></td> </tr> <tr> <td><p>E-mail:</p></td> <td colspan="2"><input name="email" type="text" id="email" size="50" /></td> </tr> <tr> <td><p>Mensagem: </p> <label></label></td> <td colspan="2" valign="top"><textarea name="mensagem" cols="38" rows="6" id="mensagem"></textarea></td> </tr> <tr> <td><p>Selecione o anexo: </p></td> <td colspan="2" valign="top"><input name="attachment" type=file size="35"></td> </tr> <tr> <td><label></label></td> <td width="260"><label> </label><div align="right"> <input name="limpar" type="reset" id="limpar" value="Limpar" /> </div> </td> <td width="51"> <div align="right"> <input name="send" type="submit" id="enviar" value="Enviar" /> </div></td> </tr> </table> </form></body></html>
e aqui vai o ASP problemático:
<% Dim mySmartUploadDim intCountSet mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")mySmartUpload.UploadintCount = mySmartUpload.Save("upload") dim body body="Este e-mail foi enviado pelo formulário de contato do site MAXXDATA." & "<br>" & vbcrlf body=body & "Seguem abaixo as informações do usuário:" & "<br><br>" & vbcrlf body=body& vbcrlf body=body& "Nome: " & mySmartUpload.form("nome") & "<br><br>" & vbcrlf body=body& vbcrlf body=body&"E-mail: " & mySmartUpload.form("email")& "<br><br>" &vbcrlf body=body&"Telefone: " & mySmartUpload.form("telefone")& "<br><br>" &vbcrlf body=body& vbcrlf body=body&"Mensagem: " & vbcrlf & mySmartUpload.form("mensagem") If mySmartUpload.Form("Send") <> "" Then Set Mail = Server.CreateObject("Persits.MailSender") Mail.From = "maxxdata@maxxdata.com.br" Mail.FromName = "Banco de Currículos Maxxdata" Mail.Host = "mail.maxxdata.com.br" Mail.Subject = "Currículo" Mail.Body = body Mail.AddAddress "ecorrea@maxxdata.com.br" If Not mySmartUpload.Files("attachment") Is Nothing Then Mail.AddAttachment mySmartUpload.Files("attachment").Path End If 'response.Write(Mail.AddAttachment Upload.Files("Attachment").Path) Mail.Send Response.Write "Successo!" End If%>
O que pode estar de errado? Por favor preciso de uma ajuda urgente!
Obrigado a todos.
Edson
Carregando comentários...