今、こんな感じです。
#include"hspsock.as"
sdim GetLog,1024
PopServer="pop.mail.yahoo.co.jp"
PopPort=110
AccountName="アカウントのユーザーネーム"
AccountPass="アカウントのパス"
sockopen 0,PopServer,PopPort
sockget GetLog,1024,0
sockput"user "+AccountName+"\n",0
sockget GetLog,1024,0
sockput"pass "+AccountPass+"\n",0
sockget GetLog,1024,0
sockput"stat\n",0
sockget GetLog,1024,0
getstr MailCount,GetLog,4,' '
repeat int(MailCount)
sockput"TOP "+cnt+" 0\n",0
sockget GetLog,1024,0
dialog GetLog
await 1
loop
sockput"quit\n",0