tell application "Mail" set acctListFile to (open for access "/Users/jmcamer1/Documents/blog/applescript-mail/allaccts.txt" with write permission) set accountList to "" repeat with i in every account set accountList to accountList & "Name: " & name of i & " " set accountList to accountList & "User name: " & user name of i & " " set accountList to accountList & "Type: " & account type of i & " " set accountList to accountList & "Email addresses: " & email addresses of i & " " set accountList to accountList & "Server name: " & server name of i & " " set accountList to accountList & "Port: " & port of i & " " set accountList to accountList & "Directory: " & account directory of i & " " end repeat write accountList to acctListFile close access acctListFile end tell