Login   Register  
PHP Classes
elePHPant
Icontem

File: test_email_sender.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Josť Augusto Ferreira Franco  >  Class Email Sender  >  test_email_sender.php  >  Download  
File: test_email_sender.php
Role: Example script
Content type: text/plain
Description: File test to class email_sender
Class: Class Email Sender
Validate e-mail addresses and send simple messages
Author: By
Last change:
Date: 7 years ago
Size: 1,884 bytes
 

Contents

Class file image Download
<?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>&nbsp;</td>
            <td><input type="submit" name="enviar" value="Enviar email"></td>
         </tr>
      </table>
   </form>


</body>
</html>