<%@ Page Language="vb" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title>UltimateMail Web Demonstration</title>
	<link rel="Stylesheet" href="Css/Styles.css" />
</head>
<body>
	<form id="myform" runat="server">
		<div class="templatecontent">
			<div class="header">
				<a href="http://www.componentpro.com">
					<img src="Css/Logo.gif" /></a>
			</div>
			This example shows how to use UltimateMail to download messages in a Web Application.<br />
			<br />
			<b>How to use:</b> All fields in <strong>bold</strong> are required.<ul>
				<li><b>Imap Server: </b>The server address. </li>
				<li><strong>Imap Port: </strong>The server port (default port is 143). </li>
				<li><strong>Security Mode: </strong>The IMAP connection security. </li>
				<li><strong>Imap User: </strong>The Imap User Name. </li>
				<li><strong>Password: </strong>The Password. </li>
				<li><strong>Authentication Method: </strong>The IMAP client authentication method.</li>
				<li><strong>Messages: </strong>The maximum number of messages to download. </li>
				<li>Click on the <strong>Send</strong> button to download messages.</li>
			</ul>
			<div class="content">
				<table border="0" cellspacing="0" cellpadding="3">
					<tr>
						<td style="white-space: nowrap">
							<b>Imap Server:</b></td>
						<td width="100%">
							<asp:TextBox ID="txtServer" runat="server" CssClass="textbox" Width="200px"></asp:TextBox></td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
						</td>
						<td>
							<asp:RequiredFieldValidator ID="rfv" runat="server" CssClass="error-1" ErrorMessage="Imap server Address is required"
								ControlToValidate="txtServer" Display="Dynamic"></asp:RequiredFieldValidator>
						</td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
							<b>Imap Port:</b></td>
						<td width="100%">
							<asp:TextBox ID="txtPort" runat="server" CssClass="textbox" Width="50px">143</asp:TextBox></td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
						</td>
						<td>
							<asp:RequiredFieldValidator ID="rfvPort" runat="server" CssClass="error-1" ErrorMessage="Imap port is required"
								ControlToValidate="txtPort" Display="Dynamic"></asp:RequiredFieldValidator>
							<asp:RangeValidator ID="rvPort" runat="server" CssClass="error-1" ControlToValidate="txtPort"
								ErrorMessage="Imap Port is invalid" MaximumValue="65535" MinimumValue="1" Type="Integer"></asp:RangeValidator>
						</td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
							Security Mode:</td>
						<td width="100%">
							<asp:DropDownList ID="ddlSecurityMode" runat="server" CssClass="dropdown" Width="200px">
								<asp:ListItem>Unsecure</asp:ListItem>
								<asp:ListItem>Implicit</asp:ListItem>
								<asp:ListItem>Explicit</asp:ListItem>
							</asp:DropDownList></td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
							<b>Imap User:</b></td>
						<td width="100%">
							<asp:TextBox ID="txtUser" runat="server" CssClass="textbox" Width="200px"></asp:TextBox></td>
					</tr>
					<tr>
						<td>
						</td>
						<td>
							<asp:RequiredFieldValidator ID="rfvUser" runat="server" CssClass="error-1" ErrorMessage="Please enter user name"
								ControlToValidate="txtUser" Display="Dynamic"></asp:RequiredFieldValidator>
						</td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
							<b>Password:</b></td>
						<td width="100%">
							<asp:TextBox ID="txtPassword" runat="server" CssClass="textbox" Width="200px" TextMode="Password"></asp:TextBox></td>
					</tr>
					<tr>
						<td>
						</td>
						<td>
							<asp:RequiredFieldValidator ID="rfvPassword" runat="server" CssClass="error-1" ErrorMessage="Please enter password"
								ControlToValidate="txtPassword" Display="Dynamic"></asp:RequiredFieldValidator>
						</td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
							<b>Authentication Method:</b></td>
						<td width="100%">
							<asp:DropDownList ID="ddlAuthentication" runat="server" CssClass="dropdown" Width="200px">
							</asp:DropDownList></td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
							<b>Folder to download:</b></td>
						<td width="100%">
							<asp:TextBox ID="txtFolder" runat="server" CssClass="textbox" Width="200px">Inbox</asp:TextBox></td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
						</td>
						<td>
							<asp:RequiredFieldValidator ID="rfvFolder" runat="server" CssClass="error-1" ErrorMessage="The working folder is required"
								ControlToValidate="txtFolder" Display="Dynamic"></asp:RequiredFieldValidator>
						</td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
							<b>Max Messages:</b></td>
						<td width="100%">
							<asp:TextBox ID="txtMessages" runat="server" CssClass="textbox" Width="50px">10</asp:TextBox></td>
					</tr>
					<tr>
						<td style="white-space: nowrap">
						</td>
						<td>
							<asp:RequiredFieldValidator ID="rfvFrom" runat="server" CssClass="error-1" ErrorMessage="The maximum number of messages to download is required"
								ControlToValidate="txtMessages" Display="Dynamic"></asp:RequiredFieldValidator>
							<asp:RangeValidator ID="rvMessages" runat="server" ControlToValidate="txtMessages"
								CssClass="error-1" ErrorMessage="The maximum number of messages to download is invalid"
								MaximumValue="100" MinimumValue="1" Type="Integer"></asp:RangeValidator></td>
					</tr>
					<tr>
						<td colspan="2">
							<asp:Label ID="lblResult" runat="server" CssClass="bodytext"></asp:Label></td>
					</tr>
					<tr>
						<td></td><td>
							<asp:Button CssClass="button" ID="btnDownload" runat="server" Text="Download" OnClick="btnDownload_Click" /></td>
					</tr>
				</table>
			</div>
		</div>
	</form>
</body>
</html>