I'd like to try to use my own script as much as possible, since I made a dialog for it. This script was working fine to get one message until I started trying to add the part to make it retrieve more than one message if there were more. I'll show you the whole sockread event.
Code:
on 1:sockread:mail:{
  sockread %temptext
  if (!$window(mail)) { window @mail }
  if (%temptext == +OK POP3 server ready.) { sockwrite -n $sockname user MyUserName }
  if (%temptext == +OK please send PASS command) { sockwrite -n $sockname pass MyPassword }
  if (%temptext == +OK MyName is welcome here) { sockwrite -n $sockname list }
  if (*messages* iswm %temptext) { 
    sockwrite -n $sockname retr $gettok(%temptext,2,32) 
    sockmark mail mail
    set %mailtotal $gettok(%temptext,2,32)
    set %N 1
  }
  if ($sockerr) {
    echo -a Error.
    halt
  }  
  if (%temptext) {
    if ($sock(mail).mark == mail) {    
      while (%N <= %mailtotal) { 
        if (*From:* iswm %temptext) { aline @mail %temptext }
        if (*Date:* iswm %temptext) { aline @mail %temptext }
        if (*Subject:* iswm %temptext) { aline @mail %temptext }
        if (*Message-Id:* iswm %temptext) { sockmark mail body }
      }
      if ($sock(mail).mark == body) {
        if (*Message-Id* iswm %temptext) { echo }
        elseif (%temptext == .) { echo }
        else { aline @mail %temptext }
      }  
      if (%temptext == .) && ($sock(mail).mark == body) {
        sockmark mail done
        inc %N
      }      
    }
  }
  unset %N
  unset %mailtotal
}

Last edited by bwr30060; 15/02/06 10:22 PM.