<!--#include file="../../owFunctions/I_GeneralFunctions.asp"-->
<!--#include file="../header.asp"-->
<%
	'************************************************************************************
	'*																					*
	'*	MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH 							*
	'*		ONEWORLDSTORE IS DONE AT YOUR OWN RISK!										*
	'*	Product  : OneWorldStore														*
	'*	Version  : 9.0000																*
	'*	Modified : June 2004															*
	'*	Copyright:	Copyright (C) 2004 OneWorldStore.Com								*
	'*				Registration Number: 1024507										*
	'*				http://strategis.ic.gc.ca/											*
	'*																					*
	'************************************************************************************
	
	Dim sAction, pEmailFrom, pEmailTo
	
	sAction			= Trim(Request("sAction"))
	sSMTPServer		= request.form("sSMTPServer")
	pEmailFrom		= request.form("pEmailFrom")
	pEmailTo		= request.form("pEmailTo")
	%>
	<body style="font-family: Arial; font-size: 11px" topmargin="0" leftmargin="0" bgcolor=C3DAF9>
		<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
			<tr>
				<td align=center valign=center>
					<table border="0" cellpadding="0" cellspacing="10" style="font-size: 11px;" bgcolor=FFFFFF>
						<tr>
							<td align=center bgcolor=EAF1F9>
								<b><%=LANG_DT( "EMAIL_TEST_HEAD", "Email Test" )%></b>
							</td>
						</tr>
						<tr>
							<td>
								<%If ( sAction = "Test" ) Then%>
								<%=LANG_DT( "EMAIL_TEST_SENDINGEMAILS", "Sending Emails..." )%>
								<%
								sOWSmtpServer = sSMTPServer
							    '*** Bamboo.SMTP ***
							    Err.Clear
							    On Error Resume Next
							    Set obj = Server.CreateObject("Bamboo.SMTP")
							    If Err.Number <> 0 Then
							    Else
									sOWEmailComponent = "BambooSMTP"
									call sendMail(pEmailFrom, pEmailFrom, pEmailTo, LANG_DT( "EMAIL_TEST_SUBJECT", "OneWorldStore e-mail diagnostics" ), "Bamboo.SMTP works!")
									sSuccess = LANG_DT( "EMAIL_TEST_SENDBAMBOO", "<br><li>Sending Bamboo.SMTP..." )
							    End If
							    Set obj = Nothing
							    On Error Goto 0
							    
							    '*** Dimac JMail ***
							    Err.Clear
							    On Error Resume Next
							    Set obj = Server.CreateObject("JMail.SMTPMail")
							    If Err.Number <> 0 Then
							    Else
									sOWEmailComponent = "Jmail"
									call sendMail(pEmailFrom, pEmailFrom, pEmailTo, LANG_DT( "EMAIL_TEST_SUBJECT", "OneWorldStore e-mail diagnostics" ), "Dimac JMail works!")
									sSuccess = sSuccess & LANG_DT( "EMAIL_TEST_SENDJMAIL", "<br><li>Sending Dimac JMail..." )
							    End If
							    Set obj = Nothing
							    On Error Goto 0
							    
							    '*** Microsoft CDONTS ***
							    bCDONTS = False
							    Err.Clear
							    On Error Resume Next
							    Set obj = Server.CreateObject("CDONTS.Session")
							    If Err.Number <> 0 Then
							    Else
									sOWEmailComponent = "CDONTS"
									Call sendMail(pEmailFrom, pEmailFrom, pEmailTo, LANG_DT( "EMAIL_TEST_SUBJECT", "OneWorldStore e-mail diagnostics" ), "Microsoft CDONTS works!")
									sSuccess = sSuccess & LANG_DT( "EMAIL_TEST_SENDCDONTS", "<br><li>Sending Microsoft CDONTS..." )
							    End If
							    Set obj = Nothing
							    On Error Goto 0
							    
							    '*** Persits AspEmail ***
							    Err.Clear
							    On Error Resume Next
							    Set obj = Server.CreateObject("Persits.MailSender")
							    If Err.Number <> 0 Then
							    Else
									sOWEmailComponent = "PersitsASPMail" 
									Call sendMail(pEmailFrom, pEmailFrom, pEmailTo, LANG_DT( "EMAIL_TEST_SUBJECT", "OneWorldStore e-mail diagnostics" ), "Persits AspEmail works!")
									sSuccess = sSuccess & LANG_DT( "EMAIL_TEST_SENDPERSITS", "<br><li>Sending Persits AspEmail..." )
							    End If
							    Set obj = Nothing
							    On Error Goto 0
							    
							    '*** ServerObjects AspMail ***
							    Err.Clear
							    On Error Resume Next
							    Set obj = Server.CreateObject("SMTPsvg.Mailer")
							    If Err.Number <> 0 Then
							    Else
									sOWEmailComponent = "ServerObjectsASPMail1"
									Call sendMail(pEmailFrom, pEmailFrom, pEmailTo, LANG_DT( "EMAIL_TEST_SUBJECT", "OneWorldStore e-mail diagnostics" ), "ServerObjects AspMail works!")
									sSuccess = sSuccess & LANG_DT( "EMAIL_TEST_SENDSO", "<br><li>Sending ServerObjects AspMail..." )
							    End If
							    Set obj = Nothing
							    On Error Goto 0
							    '*** End ***
								%>
								<%If ( sSuccess <> "" ) Then%>
								<%=sSuccess%>
								<br><br>
								<%=LANG_DT( "EMAIL_TEST_EMAILSSENT", "...Emails sent. Please wait a few minutes before checking your email for the test messages." )%>
								<%Else%>
								<%=LANG_DT( "EMAIL_TEST_EMAILSENDERROR", "Unfortunately no emails were sent. It appears like there are no compatable email components installed on the server. Please contact your system administrator for more information." )%>
								<%End If%>
								<%Else%>
								<table border="0" cellpadding="0" cellspacing="10" style="font-size: 11px;" bgcolor=FFFFFF>
									<tr>
										<td><%=LANG_DT( "EMAIL_TEST_SMTP", "SMTP Server: " )%></td>
										<td><%=sOWSmtpServer%></td>
									</tr>
									<tr>
										<td><%=LANG_DT( "EMAIL_TEST_COMPONENT", "Current Email Component: " )%></td>
										<td>
											<%
											Select Case UCase(sOWEmailComponent)
												Case "JMAIL"
													Response.Write "JMail"
												Case "SERVEROBJECTSASPMAIL1"
													Response.Write "ServerObjects ASPMail"
												Case "PERSITSASPMAIL"
													Response.Write "Persits ASPMail"
												Case "CDONTS"
													Response.Write "CDONTS"
												Case "CDO"
													Response.Write "CDOSYS WIN-2003"
												Case "BAMBOOSMTP"
													Response.Write "Bamboo SMTP"
												Case "OCXMAIL"
													Response.Write "OCXMail"
												Case "ASPSMARTMAIL"
													Response.Write "AspSmartMail"
												Case "DUNDASMAIL"
													Response.Write "DundasMail"
											End Select
											%>
										</td>
									</tr>
									<tr>
										<td><%=LANG_DT( "EMAIL_TEST_OWNEREMAIL", "Store Owner Email: " )%>: </td>
										<td><%=sOWEmailAdmin%></td>
									</tr>
									<tr>
										<td><%=LANG_DT( "EMAIL_TEST_SENDEREMAIL", "From Email Address: " )%>: </td>
										<td><%=sOWEmailSender%></td>
									</tr>
									<tr>
										<td colspan=2>
											<%=LANG_DT( "EMAIL_TEST_CHECKING", "Checking email settings for validity:" )%>
											<%
											If ( UCase(Trim(sOWSmtpServer)) = "MAIL.WEBSITE.COM" ) Then
												sError = LANG_DT( "EMAIL_TEST_SMTPSETTINGS", "<br><li>Please change the SMTP Server. This can be changed within the Store Manager-&gt;Mail Configuration screen." )
											End If
											If ( UCase(Trim(sOWEmailAdmin)) = "ADMIN@WEBSITE.COM" ) Then
												sError = sError & LANG_DT( "EMAIL_TEST_ADMINEMAIL", "<br><li>Please change the administrator email address. This can be changed within the Store Manager-&gt;Mail Configuration screen." )
											End If
											If ( UCase(Trim(sOWEmailSender)) = "ADMIN@WEBSITE.COM" ) Then
												sError = sError & LANG_DT( "EMAIL_TEST_ADMINEMAIL2", "<br><li>Please change the From email address (this is the email address all emails sent from the store come from). This can be changed within the Store Manager-&gt;Mail Configuration screen." )
											End If
											If ( sError = "" ) Then
												Response.Write LANG_DT( "EMAIL_TEST_SETTINGSOK", "<br>Email settings seem to be ok. Please verify settings by running the email test below." )
											Else
												Response.Write sError
											End If
											%>
										</td>
									</tr>
								</table>
								
								<hr>
								<form name="emailtestform" method="post" action="owMain.asp">
								<input type='hidden' name='sAction' value='Test'>
								<table border="0" cellpadding="0" cellspacing="10" style="font-size: 11px;" bgcolor=FFFFFF>
									<tr> 
										<td><%=LANG_DT( "EMAIL_TEST_SMTPSERVER", "SMTP Server" )%></td>
										<td>  
											<input type="text" name="sSMTPServer" value="<%=sOWSmtpServer%>">
										</td>
									</tr>
									<tr> 
										<td><%=LANG_DT( "EMAIL_TEST_EMAILFROM", "Email From" )%></td>
										<td>  
											<input type="text" name="pEmailFrom" value="<%=sOWEmailSender%>">
										</td>
									</tr>
									<tr> 
										<td><%=LANG_DT( "EMAIL_TEST_DESTEMAIL", "Destination Email" )%></td>
										<td>  
											<input type="text" name="pEmailTo" value="<%=LANG_DT( "EMAIL_TEST_EMAILADDRESS", "Your email address here" )%>" size=25>
										</td>
									</tr>
									<tr> 
										<td> 
											<input type="submit" name="Test" value="<%=LANG_DT( "EMAIL_TEST_TEST", " Send Test Email(s) " )%>">
										</td>
										<td>&nbsp;</td>
									</tr>
								</table>
								</form>
								<%End If%>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>

	
	<!--#include file="../footer.asp"-->


