Home > Software engineering >  Vba jmail save the email for the eml has no content
Vba jmail save the email for the eml has no content

Time:10-11

Use Jmail + ADODB. Stream to preserve has been sent by email, found that can be stored into the eml file, and you can see the sender, recipient, sending date, the information such as theme, is can't see the text (the recipient can see the full text)

Use notepad to open to see, is a complete mail the original information,

What is the problem?

The Set objStream=CreateObject (" ADODB. Stream ")
With objStream
. Type=1
. Open
Jmail. Message. SaveToStream objStream
. SaveToFile "d: \ test. Eml)," 2
. Close
End With
The Set objStream=Nothing

CodePudding user response:

The Set pop3=Server. CreateObject (" JMail. Pop3 ")
The Set objStream=CreateObject (" ADODB. Stream ")
The Set of MSG=pop3. Messages. The item (j)
For j=1 to pop3 count
With objStream
. Type=1
. Open
. The Position=0
MSG. SaveToStream objStream
. SaveToFile FilePath, 2
. Close
End With
next

CodePudding user response:

The Set pop3=Server. CreateObject (" JMail. Pop3 ")
The Set objStream=CreateObject (" ADODB. Stream ")
.

For j=1 to pop3 count
The Set of MSG=pop3. Messages. The item (j)
With objStream
. Type=1
. Open
. The Position=0
MSG. SaveToStream objStream
. SaveToFile FilePath, 2
. Close
End With
The set of MSG=nothing
next
  •  Tags:  
  • VBA
  • Related