Jump to content
Sign in to follow this  
Walls192

Check For Email

Recommended Posts

Walls192

Basically I am quite new to Autoit and after I made a couple of simple programmes I decided to make a Email checker.

This is My script so far

#Include <Constants.au3>
#Include <IE.au3>
#NoTrayIcon

Opt("TrayMenuMode",1)
TrayCreateItem("")
$loginitem    = TrayCreateItem("Login")
TrayCreateItem("")
$exititem      = TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
Select
    case $msg = $loginitem
$oIE = _IECreate ("http://mail.google.com")
send("{ENTER}")
$oForm = _IEFormGetObjByName($oIE, "gaia_loginform")
$o_login = _IEFormElementGetObjByName ($oForm, "Email")
$o_password = _IEFormElementGetObjByName ($oForm, "passwd")

_IEFormElementSetValue($o_login, "******")
_IEFormElementSetValue($o_password, "*******")

_IEFormSubmit ($oForm)
If @error Then
    MsgBox(0, "Error", @error, 5)
ElseIf
    msgbox(0, "Successful", "You have logged in sucessfully", 5)
EndIf
Case $msg = $exititem
    Exit
EndSelect
WEnd
Exit

Now This just logs into gmail but I am looking for the script to see if you have email?

So can any one tell me what to add to check if I have email?

Share this post


Link to post
Share on other sites
John

The title contains the number of unread messages.

<TITLE>Gmail - Inbox (14)</TITLE>

Just retrieve the title, trim to "(" and ")" and compare to the expected value.

Share this post


Link to post
Share on other sites
BillLuvsU

A better way to do this would be to use the POP3 functions floating around. Then you could connect, retrieve a list of mail, actually download the mail, and it would probly be simpler then the IE functions. Check em out. =]


[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Share this post


Link to post
Share on other sites
Walls192

A better way to do this would be to use the POP3 functions floating around. Then you could connect, retrieve a list of mail, actually download the mail, and it would probly be simpler then the IE functions. Check em out. =]

Please can you give me an example of what you mean, I know how to send mail but how would I receive it?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.