Print This Page

Outlook Mail Autosetup

This file creates a .reg file for download which facilitates setup of Microsoft Outlook Express and Outlook 2003.  Using or modifying registry files is RISKY AT BEST!!!  USE AT YOUR OWN RISK!!  That being said its a cool script :)

 Usage Create form that submits to this handler using get w/ the variables  name, smtp server, other(any isp outgoing server)  and  then  when the  submit button is clicked the form will prompt  a download of   name.reg  which can be merged into the windows registry to autosetup outlook.
<?php

$inc_prefix = $_GET[inc];
$smtp_server = $_GET[smtp_server];
$mode = $_GET[mode];
$isp = $_GET[isp];

$name = $_GET[name];
$domain = $_GET[domain];
$other = $_GET[other];
$isp = (empty($isp)) ? $other : $isp;
$organization = ucfirst($domain); $organization = explode('.',$organization);
$email = $name."@".$domain;

switch ($isp)
{
case 'aol'; $smtp_server = 'smtp.aol.com'; break;
case 'com'; $smtp_server = 'smtp.comcast.net'; break;
case 'bel'; $smtp_server = 'mail.bellsouth.net'; break;
case 'ver'; $smtp_server = 'outgoing.verizon.net'; break;
case 'sky'; $smtp_server = 'mail.skynap.net'; break;
}

$header = 'REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\\'.$name.']';

$pop3 = <<<END
$header
"DCEmail"=dword:00000002
"POP3 Server"="$inc_prefix.$domain"
"POP3 Port"=dword:0000006e
"SMTP Server"="$smtp_server"
"SMTP Port"=dword:00000019
"Connection Type"=dword:00000003
"POP3 User Name"="$email"
"SMTP Display Name"="$email"
"SMTP Email Address"="$email"
"SMTP Reply To Email Address"="$email"
"SMTP Organization Name"="$organization[0]"
"Account Name"="$email"
"POP3 Timeout"=dword:0000003c
"SMTP Timeout"=dword:0000003c
"POP3 Secure Connection"=dword:00000000
"Leave Mail On Server"=dword:00000000
"POP3 Skip Account"=dword:00000000
"POP3 Prompt for Password"=dword:00000000
"SMTP User Name"="$email"
"SMTP Use Sicily"=dword:00000003
"SMTP Secure Connection"=dword:00000000
"SMTP Split Messages"=dword:00000000
"SMTP Prompt for Password"=dword:00000000
END;

$imap = <<<END
$header
"DCEmail"=dword:00000002
"IMAP Server"="$inc_prefix.$domain"
"IMAP Port"=dword:0000008f
"SMTP Server"="$smtp_server"
"SMTP Port"=dword:00000019
"Connection Type"=dword:00000003
"IMAP User Name"="$email"
"SMTP Display Name"="$email"
"SMTP Email Address"="$email"
"SMTP Reply To Email Address"="$email"
"SMTP Organization Name"="$organization[0]"
"Account Name"="$email"
"IMAP Timeout"=dword:0000003c
"SMTP Timeout"=dword:0000003c
"IMAP Secure Connection"=dword:00000000
"IMAP Skip Account"=dword:00000000
"IMAP Prompt for Password"=dword:00000000
"SMTP User Name"="$email"
"SMTP Use Sicily"=dword:00000003
"SMTP Secure Connection"=dword:00000000
"SMTP Split Messages"=dword:00000000
"SMTP Prompt for Password"=dword:00000000
"IMAP Root Folder"=""
"IMAP Polling"=dword:00000001
"IMAP Poll All Folders"=dword:00000001
"IMAP Dirty"=dword:00000000
END;

if ( (empty($name)) || (empty($domain)) || (empty($isp)) )
{
echo 'Variables are not set. Contact the person who sent you the link and ask them to resend.';
}
else
{

header('Content-type: text/reg');
header('Content-Disposition: attachment; filename="SetupOutlook'.$email.'.reg"');
$output = ($mode == "imap") ? $imap : $pop3 ;
echo $output;

}
?>

Add your comments or bugfixes below.

Add A Comment

Add A Comment

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)
Code in the picture:
Your Name(*):
Comment(*):
 


Previous page: Ftp Spread
Next page: Js vs PHP: Dates