<?php
/**
*@author José Augusto Ferreira Franco
*@copyright Artistic Lisence
*@link http://guto.awardspace.com
*@package Class Email_Sender [file test]
*@version 1.0 done at 12 Nov 2006
*/
require "class_email.php";
if(isSet($_POST['enviar']))
{
$nome = $_POST['nome'];
$email = $_POST['email'];
$assunto = $_POST['assunto'];
$msg = $_POST['msg'];
foreach($_POST as $values)
{
if(empty($values))
{
echo "Existem campos vazios";
print "<meta http-equiv='refresh' content='1;url=".basename(__FILE__)." '>";
exit();
}else
{
$data = array("to" => "{$email}",
"subject" => "{$assunto}",
"from" => "{$nome}",
"message" => "{$msg}");
// enviando o email ....
$mail = new email_sender($data);
}
}
$mail = new email_sender();
}
?>
<html>
<head>
<title>Enviar Email</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Nome:</td>
<td><input type="text" name="nome"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>Assunto</td>
<td><input type="text" name="assunto"></td>
</tr>
<tr>
<td valign="top">Messagem:</td>
<td><textarea name="msg"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="enviar" value="Enviar email"></td>
</tr>
</table>
</form>
</body>
</html>
|