原帖由 stjie 于 2008-5-23 16:31 发表
写注册表不行,整了N天都没查出个所以然来
这个很简单的!我在公司就是用这种方法自动设置OE的!密码要自己填!配套功能自己做。可以全自动化!
;;;;;;这个是添加到当前用户的,用的是OE,要添加到其它用户,就要获取其SID,找到对应注册表项,都简单
;$accountName 帐户名
;$emailAddress 邮件地址,可以根据帐户名生成
;$popServer,$smtpServer 邮件服务器地址
Func addEmail($accountName,$emailAddress,$popServer,$smtpServer)
$num = "00000001" ;;;这个值自己处理,从00000001开始,每个帐户一个
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"Account Name","REG_SZ",$popServer)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"Connection Type","REG_DWORD","3")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"POP3 Prompt for Password","REG_DWORD","0")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"POP3 Server","REG_SZ",$popServer)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"POP3 Use Sicily","REG_DWORD","0")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"POP3 User Name","REG_SZ",$accountName)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"SMTP Display Name","REG_SZ",$accountName)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"SMTP Email Address","REG_SZ",$emailAddress)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\"&$num,"SMTP Server","REG_SZ",$smtpServer)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager","Default Mail Account","REG_SZ",$num)
EndFunc
[ 本帖最后由 hehui 于 2008-6-12 12:26 编辑 ] |