Anexar arquivos

2 respostas
G

pessoal alguém tem alguma coisa sobre como anexar arquivos em java?
agradeço

2 Respostas

J

pelo que entendi vc ker enviar um anexo via e-mail???

sefor…
abaixo vai um jsp de e-mail enviando um anexo…

<%
    ' Declare Variables
    Dim objJMail, strFilePath
    ' Get absolute path for file we want to attach to email.
    strFilePath = Server.MapPath("files/eternal-youth.pdf")
    ' Create instance of JMail Object
    Set objJMail = Server.CreateObject("JMail.SMTPMail")
    ' JMail SMTP on server
    objJMail.ServerAddress = "mail.gimmick-prodo.co.uk"
    ' JMail ContentType
    objJMail.ContentType = "text/plain"
    ' Senders email address
    objJMail.Sender = "[email removido]"
    ' Senders name
    objJMail.SenderName= "Gimmick Productions Ltd"
    ' Recipients email address
    objJMail.AddRecipient("[email removido]")
    ' Email Priority (3 = Normal)
    objJMail.Priority = 3
    ' Email Title
    objJMail.Subject = "Discover the secret to eternal youth"
    ' Email Body
    objJMail.Body = "Send $50 and we'll send you the secret to eternal youth!"
    ' Attach file to email
    objJMail.AddAttachment(strFilePath)
    ' Send Email
    objJMail.Execute()
    ' Close JMail Object and Destroy it to release memory
    objJMail.Close()
    Set objJMail = Nothing    
%>

obs… atente para " objJMail.AddAttachment(strFilePath) " q realiza o anexo…

espero ter ajudado…

atenciosamente

N

O que ser isso?
ASP, VBScript?

Criado 8 de outubro de 2004
Ultima resposta 9 de out. de 2004
Respostas 2
Participantes 3