Login Info
Logging into email automantically
Monday, July 31, 2006 by Automan | Discussion: DesktopX
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
Reply #2 Monday, July 31, 2006 1:22 PM
Reply #3 Monday, July 31, 2006 1:26 PM
Reply #4 Tuesday, August 1, 2006 5:47 AM
Please email me the object and I will try to apply the script.
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!







Reply #1 Monday, July 31, 2006 4:52 AM
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