Example 2 Edit an EML Email File....

Topics related to David de Argentina's NeoThinBasic plug-in.

Moderator: Neosoft Support

Post Reply
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Example 2 Edit an EML Email File....

Post by David de Argentina »

Purpose: Extract all images within an EML Email file, to prevent hacking actions ( like Outlook Express does )

The ThinBasic Program

(Save as ExtractImages.tBasic)

Code: Select all

USES "FILE"

Global infile as string
Global outfile as string

dim i as long
dim Texto as string
dim cuantos_tag as long
dim src as string
dim tags as string
dim found as string

'-----------------------------------------
' this lines are for NeoBook compatibility
'<<<infile>>>
'<<<outfile>>>
'-----------------------------------------

texto = FILE_LOAD(infile)
cuantos_tag = parseCount(texto,"<img")

if cuantos_tag > 1 then
  for i = 2 to cuantos_tag
    tags = parse$(texto,"<img",i)
    src = parse$(tags,"src=",2)
    found = parse$(src,chr$(34),2)
    Texto = REMOVE$(Texto, found)
  Next i   
End if

FILE_SAVE(outfile, Texto)
MsgBox (0,"Done")
The NeoBook Program:

using a button in a NeoBook program, put this code into the actions properties:

Code: Select all

ae_TB_Reset
ae_TB_Init
ae_TB_LoadScript "ExtractImages.tBasic" "F"
ae_TB_SetVar "infile" "MiSelected.EML" "S"     <-- Change as needed
ae_TB_SetVar "outfile" "MiProcessed.EML" "S"   <-- Change as needed
ae_TB_Run ""
Save the Neobook Program.
Be sure the thinCore.dll file should be located at the same folder of the Neobook PUB
Be sure the thinBasic_File.dll file should be located at the "BIN" folder within the program folder
Run the program using F9

Enjoy !
Post Reply