quarta-feira, 1 de dezembro de 2010

newsletter - parte 1

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$cabecalho="From:mloureiro1973@gmail.com\r\n";
$cabecalho=$cabecalho."Content-Type: text/html; \r\n charset=\"UTF-8\"\r\n";
$mensagem='<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Titulo da pagina</title>
</head>

<body bgcolor="#999999">
<table width="510" border="0" cellspacing="0" cellpadding="5" bgcolor="#eeeeee">
  .........

</html>';
mail("destinatario", "titulo da mensagem",$mensagem , $cabecalho);

}
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
  <input type="text" name="email" id="email" />
  <input type="submit" name="button" id="button" value="Submit" />
  <input type="hidden" name="MM_insert" value="form1" />
</form>
</body>
</html>