Results 1 to 6 of 6

Thread: PHP script for Auto configuration file for Outlook Express

  1. #1
    Join Date
    Aug 2006
    Posts
    181

    PHP script for Auto configuration file for Outlook Express

    I have tried to search a PHP script for auto configuration file for Outlook Express, but I didn't get the desired results. That's why I thought that posting it here can prove some useful point. I am searching for the PHP script that can generate a .reg file for e-mail account auto-configuration for outlook or outlook express. Any other script will also do, but I think giving the PHP will be more better for me. Please help me soon.
    QTechnology Ultra-Quiet ATX PSU 460W I MSI K8N Neo4-F I AMD Opteron 144 CABNE0545 2.66Ghz I 2 x 512MB RAM I 380GB Maxtor SATAI Raid0 Hard Drive I 40GB Maxtor IDE Hard Drive I Nvidia GeForce 7900GTX I Win XP Home Service Pack 2 I Soundblaster Xtreme Fidelity Fatal1ty I Mercury Home Theater HT-4500

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: PHP script for Auto configuration file for Outlook Express

    You can enable or disable Outlook Express auto-configuration files by using the WebHost Manager. By using the WebHost Manager, you are allowed to use the CPanel, which on simply clicking the link next to an e-mail address and your server will install Outlook Express registry settings on their computer. Using this function, you can prevent a lot of things like support requests, as configuring e-mail clients is a common problem for users. Also this feature only works for users who are using Microsoft Windows. Here are the steps to enable or disable Outlook Express auto-configuration files :
    1. In the CPanel 6 menu, click on the Enable/Disable Outlook AutoConfig link.
    2. Then click on the respective buttons that you want to do with the auto configuration. Like you can click on the Enable button to enable Outlook Express auto configuration files or click on the Disable button to disable Outlook Express

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: VBScript for Auto configuration file for Outlook Express

    I was knowing the VBScript for Auto configuration file for Outlook Express. You will get some hints from this codings :

    Code:
    'Require all variables to be DIM'd
    Option Explicit
    
    'Define constants for use in script
    Const ForReading = 1
    Const ForWriting = 2
    Const ForAppending = 8
    Const ReadOnly = 1
    Const HKCR = &H80000000
    Const HKCU = &H80000001
    Const HKLM = &H80000002
    Const HKUS = &H80000003
    
    Dim Wsh 'Shell object
    Dim objOLK  'Object to hold instance of Outlook
    Dim OLKVer  'First digit of Outlook Version number
    Dim OLPath  'Path to Outlook.exe
    Dim strDirName 'The path to search for PSTs and PABs
    Dim refWMIService 'WMI Object
    Dim refDirectory 'Handle to directory
    Dim objNet 'Handle to Network object
    Dim strUName 'Users login name
    Dim pCurrentDir 'Directory name passed to the EnumerateFiles function
    Dim PSTs  'Variable used in function.  Contains an array of PSTs
    Dim PABs  'Variable used in function.  Contains an array of PABs
    Dim RetVal  'Generic holder for return values
    
    'Create an instance of Outlook so that it can be queried for it's version
    Set objOLK = CreateObject("Outlook.Application")
    'Extract the first digit from the version number (this is the major version number)
    OLKVer = left(objOLK.Version,inStr(1,objOLK.Version,".")-1)
    'Close the instance of Outlook
    objOLK.Quit
    
    'If Outlook version is later than 2000 then make this registry change so that Outlook imports the PRF on first run
    If OLKVer > 9 Then
    Set Wsh = CreateObject("Wscript.Shell")
    If CheckRegKey("HKEY_CURRENT_USER\Software\Microsoft\Office\" & OLKVer & ".0\Outlook\Setup\First-Run") = TRUE Then
     RetVal = Wsh.RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Office\" & OLKVer & ".0\Outlook\Setup\First-Run")
    End If
    RetVal = Wsh.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\" & OLKVer & ".0\Outlook\Setup\ImportPRF","h:\Exchange\Outlook.prf")
    Set Wsh = Nothing
    End If
    
    'Define the path to the PSTs and PABs
    strDirName = "h:\exchange"
    
    'Create a WMI object to be used in the EnumerateFiles function
    Set refWMIService = GetObject("winMgmts:")
    'Get a handle to the directory specified in strDirName
    Set refDirectory = GetObject("winMgmts:Win32_Directory='" & strDirName & "'")
    'Create a network object, then use it to get the users login name
    Set objNet = CreateObject("WScript.NetWork")
    strUName = objNet.UserName
    
    'Call function to enumerate all PSTs and the latest PAB in strDirName folder
    EnumerateFiles(refDirectory)
    
    'Close WMI and Directory objects
    set refDirectory = Nothing
    set refWMIService = Nothing
    
    'Display completion message
    Wscript.Echo "Profile created for " & strUName

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: PHP script for Auto configuration file for Outlook Express

    I would like to tell you something. While using the VBScript, an Anti-Virus application (like the Norton or MacAfee,etc) may display a warning when the script is run. Whenever you are running the VBScript file, such warnings are automatically displayed any time and it does NOT mean that a virus is detected in the script. You can continue or allow the script to Run. Hope that this tip can help you while downloading the script for the auto configuration file for Outlook Express.

  5. #5
    Join Date
    Mar 2008
    Posts
    349

    Re: PHP script for Auto configuration file for Outlook Express

    At last got the PHP Script for the auto configuration file for Outlook Express. Here is the coding for that :
    Code:
    set oShell = wscript.CreateObject("Wscript.Shell")
    
    Function main()
        dim username, domain, displayname
    
        
        username = inputbox("Enter your USERNAME (Do not include @oconnorsinternet.com at the end)","O'Connor's Internet Email Setup")
        
        If username = "" Then
            wscript.Quit(0)
         End If
         
         If username = "Username" Then
             while username = "Enter your Email PREFIX or USERNAME"
                 username = inputbox("Enter your Email PREFIX or username (before the @ sign)","Outlook Express Profile Creator","Username")
                     If username = "" Then
                        wscript.Quit(0)
                     End If
             wend
         End If
                         
    
        displayname = inputbox("Enter your DISPLAY NAME (The name you want people to see when you E-Mail them","O'Connor's Internet Email Setup")
        
        If displayname = "" Then
            wscript.Quit(0)
         End If
         
        domain = "Enteryourdomainhere.com"
             
    
    '    displayname = Ltrim(fixme(displayname))
    '    username = Ltrim(fixme(username))
    '    domain = fixme2(domain)
    
    'EXAMPLE STRING FOR RTRIM
    '    RTrim(string)
    
        call placeMailSettings(username, displayname, domain)
        
        msgbox("Outlook Express Configuration Complete, please start Outlook Express and enter your password when prompted.")
    End Function
    
    Function regRead(regStr)
      regRead = oShell.RegRead(regStr)
    End Function
    
    Function regWrite(val1,val2,val3)
      oShell.RegWrite val1,val2,val3
    End Function
    
    Function regDelete(regStr)
      call oShell.RegDelete(regStr)
    End Function
    
    'Function fixme(strValue)
    '    dim userEntry
    '    userEntry = split(strValue, "@")
    '    fixme = userEntry(0)
    'End Function
    
    'Function fixme2(strValue2)
    '    dim userEntryd
    '    userEntryd = split(strValue2, "@")
    '    fixme2 = userEntryd(0)
    'End Function
    
    
    'EXAMPLE STRING FOR SPLIT
    '    Split(expression[,delimiter])
    
    
    
    '----------------------------------------------------------------------------------------
    ' Place new settings for Mail
    '----------------------------------------------------------------------------------------
    
    Function placeMailSettings(theUsername, thedisplayname, theDomain)
        On Error Resume Next
        dim newAccountNum, numKeyStr
        dim username, displayname, domain
        newAccountNum = regRead("HKCU\Software\Microsoft\Internet Account Manager\Account Name")
        
        If newAccountNum = "" Then
            newAccountNum = "00000001"
        ElseIf newAccountNum < 9 Then
            newAccountNum = "0000000" & newAccountNum
        Else
            newAccountNum = "000000" & newAccountNum    
        End If
        
        numKeyStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & ""
        call regWrite(numKeyStr, newAccountNum, "REG_SZ")
        
        username = theUsername
        displayname = thedisplayname
        domain = theDomain
    
        'Add Account Name
          accName = username & "@" & domain
          accNameStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "Account Name"
          call regWrite(accNameStr, accName, "REG_SZ")
    
        'Add Connection Type
          conType = "3"
          conTypeStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "Connection Type"
          call regWrite(conTypeStr, conType, "REG_DWORD")
          
        'Delete Connection Id
          conId = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "ConnectionId"
          call regDelete(conId)
          
        'Delete Account Id
          accId = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "Account ID"
          call regDelete(accId)
    
        'Delete IMAP Server
          imapSvr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "IMAP Server"
          call regDelete(imapSvr)
    
        'Delete HTTP Mail Server
          httpSvr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "HTTPMail Server"
          call regDelete(httpSvr)
    
        'Set POP3 Server
          pop3svr = "mail." & domain
          pop3svrStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "POP3 Server"
          call regWrite(pop3svrStr, pop3svr, "REG_SZ")
    
        'Set POP3 Username
          pop3usr = username & "@" & domain
          pop3usrStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "POP3 User Name"
          call regWrite(pop3usrStr, pop3usr, "REG_SZ")
    
        'Delete POP3 Password 2
          popPwdStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "POP3 Password2"
          call regDelete(popPwdStr)
    
        'Set POP3 Use Sicily
          useSicily = "0"
          useSicilyStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "POP3 Use Sicily"
          call regWrite(useSicilyStr, useSicily, "REG_DWORD")
    
        'Set POP3 Prompt for Pw
          var promptPw = "1"
          var promptPwStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "POP3 Prompt for Password"
          call regWrite(promptPwStr, promptPw, "REG_DWORD")
        
        'Set SMTP Server
          smtpSvr = "mail." & domain
          smtpSvrStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "SMTP Server"
          call regWrite(smtpSvrStr, smtpSvr, "REG_SZ")
          
        'Set SMTP Display name
          smtpDisp = displayname
          smtpSvrStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "SMTP Display Name"
          call regWrite(smtpSvrStr, smtpDisp, "REG_SZ")
    
        'Set SMTP E-mail address
          smtpEmail = username & "@" & domain
          smtpEmailStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "SMTP Email Address"
          call regWrite(smtpEmailStr, smtpEmail, "REG_SZ")
    
        'Set SMTP Use Sicily
          smtpUseSicily = "2"
          smtpUseSicilyStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccounts" & newAccountNum & "SMTP Use Sicily"
          call regWrite(smtpUseSicilyStr, smtpUseSicily, "REG_DWORD")
          
        'Set New Account to default
          defAccStr = "HKCUSoftwareMicrosoftInternet Account ManagerDefault Mail Account"
          call regWrite(defAccStr, newAccountNum, "REG_SZ")
          
        'Increment future account number
          futAccNum = newAccountNum + 1
          futAccNumStr = "HKCUSoftwareMicrosoftInternet Account ManagerAccount Name"
          call regWrite(futAccNumStr, futAccNum, "REG_DWORD")
          
          msgbox("POP3 Server Set to: " & pop3svr & chr(10) & "SMTP Server Set to: " & smtpSvr)
    End Function
    
    call main()

  6. #6
    Join Date
    Nov 2008
    Posts
    996

    Re: PHP script for Auto configuration file for Outlook Express

    According to me, it wouldn't be difficult to create this using .reg file like the file used by the cpanel. You can write a simple php form to generate the file.reg download to be run. I think that if you add the following to the .htaccess that will add the .reg to process.
    Code:
    <Files email.reg>
    ForceType application/x-httpd-php
    </Files>
    Then you can input directories were just copied from Cpanel from their email.reg file. Also I guess, this method would work and you could easily add the funtionality for other email clients as they are released.
    Code:
    //Input from some form where $acct is set to the person's email address and $app is set to their email client name
    
    if (eregi("^([a-z0-9]+)([._-]([a-z0-9]+))*[@]([a-z0-9]+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$", $acct)) {
    // Email is valid
    $email = $acct;
    } else {
    $email = "";
    exit;
    }
    
    // Use email address to split based on @ symbol to create
    // the incoming/outgoing mail server
    $acct_array = explode("@", $acct);
    $name = $acct_arry[0];
    $domain = $acct_array[1];
    //$email = ""
    $server = mail . "." . $domain;
    print "REGEDIT4\r\n\r\n";
    // Following for Pop setup
    if($app == "outlook"){
    print "[HKEY_CURRENT_USER\\Software\\Microsoft\\Office\\Ou tlook\\OMI Account Manager\\Accounts\\$email]\r\n";
    } elseif ($app == "outlookexpress"){
    print "[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Account Manager\\Accounts\\$email]\r\n";
    }
    
    // Rest of this is the same for both Outlook and Outlook Express for pop3
    print "\"DCEmail\"=dword:00000002\r\n";
    print "\"POP3 Server\"=\"$server\"\r\n";
    print "\"POP3 Port\"=dword:0000006e\r\n";
    print "\"SMTP Server\"=\"$server\"\r\n";
    print "\"SMTP Port\"=dword:00000019\r\n";
    print "\"Connection Type\"=dword:00000003\r\n";
    print "\"POP3 User Name\"=\"$email\"\r\n";
    print "\"SMTP Display Name\"=\"$email\"\r\n";
    print "\"SMTP Email Address\"=\"$email\"\r\n";
    print "\"SMTP Reply To Email Address\"=\"$email\"\r\n";
    print "\"SMTP Organization Name\"=\"\"\r\n";
    print "\"Account Name\"=\"$email\"\r\n";
    print "\"POP3 Timeout\"=dword:0000003c\r\n";
    print "\"SMTP Timeout\"=dword:0000003c\r\n";
    print "\"POP3 Secure Connection\"=dword:00000000\r\n";
    print "\"Leave Mail On Server\"=dword:00000000\r\n";
    print "\"POP3 Skip Account\"=dword:00000000\r\n";
    print "\"POP3 Prompt for Password\"=dword:00000001\r\n";
    print "\"SMTP User Name\"=\"$email\"\r\n";
    print "\"SMTP Use Sicily\"=dword:00000002\r\n";
    print "\"SMTP Secure Connection\"=dword:00000000\r\n";
    print "\"SMTP Split Messages\"=dword:00000000\r\n";
    print "\"SMTP Prompt for Password\"=dword:00000000\r\n";
    
    header("content-type: text/plain");
    header("content-Transfer-Encoding: ascii");
    header("Pragma: no-cache");
    header("Expires: 0");

Similar Threads

  1. How to repair damaged DBX file of outlook express
    By Faithist in forum Windows Software
    Replies: 8
    Last Post: 25-04-2012, 06:42 PM
  2. Unwanted auto text in Outlook Express
    By Lakshmikantan in forum Windows Software
    Replies: 3
    Last Post: 15-09-2011, 08:10 PM
  3. Can i create an auto executable jar file for fx script
    By Jona-thon in forum Software Development
    Replies: 5
    Last Post: 23-07-2010, 03:39 AM
  4. Quickly add a file to a message in Outlook Express
    By Spykar in forum Tips & Tweaks
    Replies: 1
    Last Post: 04-05-2009, 07:40 PM
  5. Cannot Open .pps File in Outlook Express?
    By QUINEISHA in forum Operating Systems
    Replies: 3
    Last Post: 05-03-2009, 10:49 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,533,846.44321 seconds with 17 queries