<?php
	$em_default = "";
	$em_sendmail = "";
	$em_qmail = "";
	$em_smtp = "";
	$em_ssl = "";
	$em_tls = "";
	if($app_config['email_send_method'] == "default")
		$em_default = "selected";
	else if($app_config['email_send_method'] == "sendmail")
		$em_sendmail = "selected";
	else if($app_config['email_send_method'] == "smtp")
		$em_smtp = "selected";
	if($app_config['email_smtp_secure'] == "ssl")
		$em_ssl = "selected";
	else if($app_config['email_smtp_secure'] == "tls")
		$em_tls = "selected";
	
?>							
							
							<h3>Email Settings</h3>
							
							<div class="dotline"></div>
							
							<form id="email-setup-form">
							
							<p><label for "email_from_address">From Address</label>
							<input type="text" id="email_from_address" name="email_from_address" value="<?php echo $app_config['email_from_address']; ?>" autocomplete="off" style="width:260px;"></p>
							
							<p><label for "email_from_name">From Name</label>
							<input type="text" id="email_from_name" name="email_from_name" value="<?php echo $app_config['email_from_name']; ?>" autocomplete="off" style="width:260px;"></p>
							
							<p><label for "email_reply_address">Reply Address</label>
							<input type="text" id="email_reply_address" name="email_reply_address" value="<?php echo $app_config['email_reply_address']; ?>" autocomplete="off" style="width:260px;"></p>
							
							<p><label for "email_reply_name">Reply Name</label>
							<input type="text" id="email_reply_name" name="email_reply_name" value="<?php echo $app_config['email_reply_name']; ?>" autocomplete="off" style="width:260px;"></p>
							
							<p><label for "email_send_method">Send Method</label>
							<select id="email_send_method" name="email_send_method">
							  <option value="default" <?php echo $em_default; ?>>Default</option>
							  <option value="sendmail" <?php echo $em_sendmail; ?>>Sendmail</option>
							  <option value="qmail" <?php echo $em_qmail; ?>>qmail</option>
							  <option value="smtp" <?php echo $em_smtp; ?>>SMTP</option>
							</select>
							
							<div id="smtpsetup">
								<div class="dotline"></div>
								
								<p><label for "email_smtp_secure">Protocol</label>
								<select id="email_smtp_secure" name="email_smtp_secure">
								  <option value="ssl" <?php echo $em_ssl; ?>>SSL</option>
								  <option value="tls" <?php echo $em_tls; ?>>TLS</option>
								</select>
							
								<p><label for "email_smtp_server">SMTP Server</label>
								<input type="text" id="email_smtp_server" name="email_smtp_server" value="<?php echo $app_config['email_smtp_server']; ?>" autocomplete="off" style="width:260px;"></p>
								
								<p><label for "email_smtp_port">SMTP Port</label>
								<input type="text" id="email_smtp_port" name="email_smtp_port" value="<?php echo $app_config['email_smtp_port']; ?>" autocomplete="off" style="width:260px;"></p>
								
								<p><label for "email_smtp_user">SMTP User</label>
								<input type="text" id="email_smtp_user" name="email_smtp_user" value="<?php echo $app_config['email_smtp_user']; ?>" autocomplete="off" style="width:260px;"></p>
								
								<p><label for "email_smtp_password">SMTP Password</label>
								<input type="password" id="email_smtp_password" name="email_smtp_password" value="<?php echo $app_config['email_smtp_password']; ?>" autocomplete="off" style="width:260px;"></p>
							</div>
							
							<div class="dotline"></div>
							
							<input type="hidden" id="lgptoken" name="lgptoken" value="<?php echo_form_token('email-setup-form'); ?>">
							<p><label for "submitemailsetup">&nbsp;</label>
							<button id="submitemailsetup" style="width:80px;">Submit</button> &nbsp&nbsp;
							<img id="em_status_img" src="lib/css/img/blank.png" width="16" height="16" alt="">
							</p>
							
							</form>
							