Page 1 of 1

Example 2 Edit an EML Email File....

PostPosted: Thu Oct 24, 2013 4:53 pm
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

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

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_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 !