Login Info

Logging into email automantically

Monday, July 31, 2006 by Automan | Discussion: DesktopX

Hey scripters;

I am having ttrouble with this script. When I save the desktop it will not save the email login info.

Is there away to just hard code the login informetion so I don't have the fill it out.

If you know how to do this please set the code areas so I can fill them in.

The Code is below: I don't use the second email section so I would just as oon get rid of it...

Code beginning:

Dim sLogin
Dim sPass
Dim sServer
Dim sType
Dim sLogin2
Dim sPass2
Dim sServer2
Dim sType2
Dim bPrompting
Dim bChecking

'Called when the script is executed
Sub Object_OnScriptEnter
Dim i
Dim PrefName
bPrompting = False
bChecking = False

Widget.AddPreference "Language"
Widget.Preference("Language").Type = "ComboList"
Widget.Preference("Language").DefaultValue = "English"
Widget.Preference("Language").Caption = "Lang./Sprache :"
Widget.Preference("Language").AddValue "English"


i = 1
For i = 1 To 2

Prefname = "Account" & i
c242AddTxtPreference(Prefname)
Prefname = "User"& i
c242AddTxtPreference(Prefname)

Prefname = "Password" & i
Widget.AddPreference Prefname
Widget.Preference(Prefname).Type = "Password"
Widget.Preference(Prefname).DefaultValue = ""
Widget.Preference(Prefname).Caption = "Password " & i

Prefname = "Server" & i
c242AddTxtPreference(Prefname)

Next

object.settimer 123, 60000
RefreshData
LanguageSettings
CheckMail

End Sub

Sub c242AddTxtPreference(PrefnameN)

Widget.AddPreference PrefnameN
Widget.Preference(PrefnameN).Type = "Text"
Widget.Preference(PrefnameN).DefaultValue = PrefnameN
Widget.Preference(PrefnameN).Caption = PrefnameN

End Sub

Sub RefreshData

Dim Accounts

sLogin = Widget.Preference("User1").Value 'object.localstorage("MailLogin")
sPass = Widget.Preference("Password1").Value 'object.localstorage("MailPass")
sServer = Widget.Preference("Server1").Value 'object.localstorage("MailServer")
sType = "POP3"


Object.Height = 60 + Accounts * 15
End Sub

Sub LanguageSettings

If Widget.Preference("Language").Value = "Deutsch" Then
Desktopx.Object("mail_btn_configure").text = "@Mail"
Desktopx.Object("mail_btn_configure").Tooltiptext = "Zum Konfigurieren klicken"
Else
Desktopx.Object("mail_btn_configure").text = "@Mail"
Desktopx.Object("mail_btn_configure").Tooltiptext = ""
End If
End Sub

Sub Widget_OnPreferencesChange
RefreshData
LanguageSettings
CheckMail
End Sub

Sub object_ontimer123
CheckMail
End Sub

Sub CheckMail
If bPrompting Or sLogin = "" Then Exit Sub
If bChecking Then Exit Sub
bChecking = True
desktopx.Object("mail_info").text = ""
ltype = 0
If stype = "IMAP" Then ltype = 1
Mail.CheckMail "1", sLogin, sPass, sServer, ltype
bChecking = False
End Sub

Sub CheckMail2
If bPrompting Or sLogin2 = "" Then Exit Sub
If bChecking Then Exit Sub
bChecking = True
desktopx.Object("mail_info2").text = ""
ltype = 0
If stype2 = "IMAP" Then ltype2 = 1
Mail.CheckMail "2", sLogin2, sPass2, sServer2, ltype2
bChecking = False
End Sub

Sub Object_OnLButtonUpEx(obj, x,y,
name = obj.name
If b= False Then
If name = "mail_btn_configure" Then
Widget.OpenProperties
End If
End If
End Sub

'method OnMailEvent
Sub Mail_OnMailEvent(requestID, mails)
If mails Then
strailing = ""
If requestID = "1" Then
If mails = 1 Then
strailing = " "
Else
strailing = " "
End If
desktopx.Object("mail_info").text = mails & strailing
Else
If requestID = "2" Then
If mails = 1 Then
strailing = " @-Mail"
Else
strailing = " @-Mails"
End If
desktopx.Object("mail_info2").text = mails & strailing
End If
End If
Else
If requestID = "1" Then
desktopx.Object("mail_info").text = "0 "
Else
If requestID = "2" Then
desktopx.Object("mail_info2").text = "0 "
End If
End If
End If
End Sub
Skarny
Reply #1 Monday, July 31, 2006 4:52 AM
I have never used the mail plugin / script. The following is my version of your script. Hopefully I've guessed all the bits missing and bits you wanted taken out correctly and it will work.

Dim sLogin
Dim sPass
Dim sServer
Dim sType

Dim bPrompting
Dim bChecking

'Called when the script is executed
Sub Object_OnScriptEnter
bPrompting = False
bChecking = False

Widget.AddPreference "Language"
Widget.Preference("Language").Type = "ComboList"
Widget.Preference("Language").DefaultValue = "English"
Widget.Preference("Language").Caption = "Lang./Sprache :"
Widget.Preference("Language").AddValue "English"

sLogin = "your_login"
sPass = "your_password"
sServer = "your server"
sType = "POP3"

object.settimer 123, 60000
LanguageSettings
CheckMail
End Sub


Sub Widget_OnPreferencesChange
LanguageSettings
CheckMail
End Sub

Sub object_ontimer123
CheckMail
End Sub

Sub CheckMail
If bPrompting Or sLogin = "" Then Exit Sub
If bChecking Then Exit Sub
bChecking = True
desktopx.Object("mail_info").text = ""
ltype = 0
If stype = "IMAP" Then ltype = 1
Mail.CheckMail "1", sLogin, sPass, sServer, ltype
bChecking = False
End If
End If
End If
End Sub

Sub Object_OnLButtonUpEx(obj, x,y,
name = obj.name
If b= False Then
If name = "mail_btn_configure" Then
Widget.OpenProperties
End If
End If
End Sub

'method OnMailEvent
Sub Mail_OnMailEvent(requestID, mails)
If mails Then
strailing = ""
If requestID = "1" Then
If mails = 1 Then
strailing = " "
Else
strailing = " "
End If
desktopx.Object("mail_info").text = mails & strailing
End If
Else
If requestID = "1" Then
desktopx.Object("mail_info").text = "0 "
End If
End If
End Sub
Automan
Reply #2 Monday, July 31, 2006 1:22 PM
Well this entry on WinCustomize won't let me hit the enter key at all. So here goes, I realla appreciate the work you did on this so I saved my DexktopX Theme with another name and the email was there. I took out all of the old script and placed yours in and DesktopX crashed? Nor I have an idea it might bemy password which is Automan{ <-- Notice the character. I wonder if that is what is messing it up? Let me know what you think and if you have any ideas why it crashed DesktopX when you try to apply the script. I may just for a test leave the character out and see what happens and get back to you on it. Thanks a million for the work and it really looks good, I may be able to get rid if the button that setsup your name, etc. for email. Automan

Posted via WinCustomize Browser/Stardock Central
Automan
Reply #3 Monday, July 31, 2006 1:26 PM
Oh well the removal of the { character made no difference. Desktop crashes after you try to save and apply the script then close the script window. Thanks Automan


Posted via WinCustomize Browser/Stardock Central
Skarny
Reply #4 Tuesday, August 1, 2006 5:47 AM
I'm not sure what's wrong, I just edited the script you provided and removed all the references to a second email account and shifted the variables where logon info etc is stored to the OnEnter Sub so you can just manually put them in there.

Please email me the object and I will try to apply the script.
Automan
Reply #5 Tuesday, August 1, 2006 2:44 PM

Hey; Wow I can use enter here? I don't beleive it! I can't wait for the Vista Professional! ___________________________________________ Any way I looked at you code where you place the login information and went down to the real code and eraced the area where it depends on that pop-up for the information. Then I placed your slogin and such and it worked!!!!  I have tested it and the DesktopX Saves it and all is well!!! I want to thank you so much for the help...from down there and when I think about it you folks are a day ahead of us. So you could say you're from the furture!!!   Thanks Again!!!

 

 Automan

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01