<html>
<head>
<title>Library as Place Survey</title>
</head>
<body>

<?php
	$dbserver = 'ulibtest1.lang.uc.edu';
	$dbuser = 'matchacl';
	$dbpass = '1r2rta1rtft';
	$db = 'systems';
	$sqlConn = @mysql_connect($dbserver, $dbuser, $dbpass) or die("Couldn't connect to server");
	$dbConn = @mysql_select_db($db, $sqlConn) or die("Couldn't select database: $db");
	
	$sql_vote = "SELECT EMailAddr FROM test ORDER BY EMailAddr";
	$vote_result = @mysql_query($sql_vote, $sqlConn) or die("Couldn't execute query. $sql_vote");
	
	while ($row = mysql_fetch_array($vote_result))
	{
		$email = $row['EMailAddr'];
		$mail_to = $email;
		$mail_subj = "Library as Place Survey";
		$mail_text = "Just a quick survey reminder.... \n" .
	               "\n" .
	               "Please take a few moments to complete the 'Library as Place' survey if you haven't had an opportunity.  If you've already participated, many thanks! \n" .
	               "\n" .
	               "Your responses will let us know the kinds of services and facilities you expect to find when you enter any of the ten libraries that comprise University Libraries and help us plan for the future. \n" .
			           "\n" .
			           "Your participation in this study will take no longer than 10 minutes. You may complete the anonymous survey on-line by clicking on the website below. The survey will be available until May 25th at 5:00 pm. \n" .
								 "\n" . 
								 "<http://www.surveymonkey.com/s.asp?u=555181903309>\n" . 
								 "\n" . 
								 "Your opinion means a lot to University Libraries! \n" . 
								 "\n" . 
								 "Sincerely, \n" . 
								 "\n" . 
								 "Holly Prochaska, MLS \n" . 
								 "University of Cincinnati \n" . 
								 "University Libraries \n" . 
								 "513-556-1389 (holly.prochaska@uc.edu)\n" . 
								 "\n" . 
								 "If you have any questions about study-related activities, you may call me at 556-1389 or reply to this email. If you have any questions about your rights as a research participant, you may call the Chair of the Institutional Review Board - Social and Behavioral Sciences at 558-5784.  \n" ;
  
	
		$mail_header = "From: holly.prochaska@uc.edu\r\n";
		$mail_header .= "X-Mailer: server\r\n";
		$mail_header .= "Reply To: holly.prochaska@uc.edu\r\n";
		$sendmail_param = "holly.prochaska@uc.edu";
		
		mail("$mail_to","$mail_subj","$mail_text","$mail_header","-f$sendmail_param");
	}
	echo"Mail sent successfully.";

?>
</body>
</html>
