I am having a problem where when I attach the file , when it arrives in a yahoo
mail file , it looses the file extention of the attachment when you save the
file.
also , if I mail it to a notes user , the file extention is a .dat file.
here is my code :
If currdoc.HasEmbedded Then
Forall o In currdoc.Items
If o.name = "$FILE" Then
Dim object1 As NotesEmbeddedObject
Set object1 = currdoc.GetAttachment(o.values(0))
filename = object1.name
Call object1.ExtractFile("C:\" + object1.name)
End If
End Forall
End If
If fileName <> "" Then
Set Child = body.createChildEntity()
Set header = child.createHeader("Content-Type")
Call header.setHeaderVal("multipart/mixed")
Set header = Child.createHeader("Content-Disposition")
Call header.setHeaderVal("attachment filename=" + fileName)
Set header = child.createHeader("Content-ID")
Call header.setHeaderVal(fileName)
Set stream = se.CreateStream
If(stream.open("C:\" +fileName )) Then
Call Child.setContentFromBytes(stream, "application/octet-stream",
ENC_IDENTITY_BINARY)
End If
Call stream.close()
Call stream.truncate()
I am having a problem where when I attach the file , when it arrives in a yahoo mail file , it looses the file extention of the attachment when you save the file.
also , if I mail it to a notes user , the file extention is a .dat file.
here is my code :
If currdoc.HasEmbedded Then Forall o In currdoc.Items If o.name = "$FILE" Then Dim object1 As NotesEmbeddedObject Set object1 = currdoc.GetAttachment(o.values(0)) filename = object1.name Call object1.ExtractFile("C:\" + object1.name) End If End Forall End If If fileName <> "" Then Set Child = body.createChildEntity() Set header = child.createHeader("Content-Type") Call header.setHeaderVal("multipart/mixed") Set header = Child.createHeader("Content-Disposition") Call header.setHeaderVal("attachment filename=" + fileName) Set header = child.createHeader("Content-ID") Call header.setHeaderVal(fileName) Set stream = se.CreateStream If(stream.open("C:\" +fileName )) Then Call Child.setContentFromBytes(stream, "application/octet-stream", ENC_IDENTITY_BINARY) End If Call stream.close() Call stream.truncate()