Re: Script for automatic pop3 mail checking...?
Simon Patten <[email protected]> Sat, 05 Mar 2005 01:18:34 +0000
| Newsgroups | gmane.network.hamster |
|---|---|
| Message-ID | <[email protected]> |
(Sorry, I sent this before and have only just realised that it bounced
as I used the wrong address.)
> I have been trying to understand how to make Hamster automatically
> check a specific number of my pop3 mailboxes (not all of them) in
> remote servers at regular intervals; but so far, I have not been able
> to get a clear idea of how to do it.
Here ya go, it should be easy enough to understand and modify for your
own use. Replace the fields in CAPS with your values and check
Hamster's help files for any commands or switches that you're not
clear about.
Save as SCRIPT.hsc in the Hamster folder and edit the Hamster entry in
'Startup' so that it reads 'C:\Hamster\hamster.exe SCRIPT.hsc'
(without the quotes) then restart Hamster using that shortcut, or
restart it and start the script from within Hamster.
(I like to have all the 'HamWaitIdle' commands in the script so that
it only does one thing at a time and I can see what's happening in the
logs, but they're not necessary.)
Cheers,
Simon.
#!hs2
#!load hamster.hsm
#
# This script pulls mail every 5 minutes and news every 10 minutes.
#
Label( Start )
AtClear
AtAdd ( Mail, "00:00", "23:55", "1111111", 5, true )
AtAdd ( News, "00:08", "23:58", "1111111", 10, true )
AtAdd ( Purge, "05:55", "", "1111111")
AtExecute
Quit
Sub Mail
HamWaitIdle
HamNewsPost
HamWaitIdle
HamSendMail("YOUR SMTP SERVER")
HamWaitIdle
HamFetchMail("POP SERVER 1", "pop3", "", "", "")
HamWaitIdle
HamFetchMail("POP SERVER 2", "pop3", "", "", "")
HamWaitIdle
HamFetchMail("POP SERVER 3", "pop3", "", "", "")
HamWaitIdle
EndSub
Sub News
HamWaitIdle
HamNewsPull("news.individual.net,nntp")
HamWaitIdle
HamNewsPull("news.microsoft.com,nntp")
HamWaitIdle
EndSub
Sub Purge
print( "Purging ..." )
HamWaitIdle
HamPurge
HamWaitIdle
EndSub
--
To post a message: [email protected]
To unsubscribe: [email protected]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ehamster/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/