Project

General

Profile

« Previous | Next » 

Revision 386

Added by Matthias almost 18 years ago

Added phpmailer class (thanks to doc)

View differences:

save.php
63 63
			$_SESSION['admin_username'] = $_POST['admin_username'];
64 64
			$_SESSION['admin_email'] = $_POST['admin_email'];
65 65
			$_SESSION['admin_password'] = $_POST['admin_password'];
66

  
67
			if(!isset($_POST['outgoing_mails'])) {
68
				$_SESSION['outgoing_mails'] = 'php';
69
			} else {
70
				$_SESSION['outgoing_mails'] = $_POST['outgoing_mails'];
71
			}
72
			$_SESSION['smtp_server'] = $_POST['smtp_server'];
73

  
66 74
		}
67 75
		// Set the message
68 76
		$_SESSION['message'] = $message;
......
257 265
}
258 266
// End admin user details code
259 267

  
268
// Get the SMTP server settings and check if valid
269
$smtp_server_used = "xxx.yourdomain.com";
270
if(isset($_POST['outgoing_mails']) AND $_POST['outgoing_mails']=="smtp") {
271
	if($_POST['smtp_server'] == "" || $_POST['smtp_server'] == "xxx.yourdomain.com") {
272
		set_error('Please define the SMTP host (Step 7) of your domain or choose option PHP mail().');
273
	} else {
274
		$smtp_server_used = $_POST['smtp_server'];
275
	}
276
}
277

  
278
// Create SMTP server output string for the config.php file
279
if($smtp_server_used == "xxx.yourdomain.com") {
280
	$smtp_server_used = "// define('WBMAILER_SMTP_HOST', '" .$smtp_server_used ."');\n";
281
} else {
282
	$smtp_server_used = "define('WBMAILER_SMTP_HOST', '" .$smtp_server_used ."');\n";
283
}   
284
// End SMTP server settings
285

  
260 286
// Try and write settings to config file
261 287
$config_content = "" .
262 288
"<?php\n".
......
273 299
"define('ADMIN_PATH', WB_PATH.'/admin');\n".
274 300
"define('ADMIN_URL', '$wb_url/admin');\n".
275 301
"\n".
302
"// some mail provider like GMX do not deliver mails send via PHP mail() function as SMTP authentification is missing\n".
303
"// in that case activate SMTP for outgoing mails: un-comment next line and specify SMTP host of your domain\n".
304
$smtp_server_used.
305
"\n".
276 306
"require_once(WB_PATH.'/framework/initialize.php');\n".
277 307
"\n".
278 308
"?>";

Also available in: Unified diff