Is this mail function correct or is ther still missing.....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Is this mail function correct or is ther still missing.....

Post by Skywalker »

Is this mail function correct or is ther still missing something?

Code: Select all

<?php 

// Mail variables
//####################################################################
$EMail = $_POST&#1111;'EMail']; //Mail adres
$Onderwerp = "Hulp nodig? studiecoaches.nl kan je helpen"; //Subject
$Tekst = "Kom snel naar studiecoaches.nl, de virtuele leer omgeving van het net en nu bij aanmelding een gratis scanner. Heb je niet zoveel zin om weg van huis te gaan of zoveel tijd ergens anders te besteden, dan is dit je kans om alles via het internet te doen. Pak je kans en ontvang zelfs een gratis scanner."; //Mail text
$Mailvan = "blabla@blabla.nl"; // Mail to
require ("header.php"); // don't know what this is?

//#####################################################################
?>

<html>

<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) &#123;  //reloads the window if Nav4 resized
  if (init==true) with (navigator) &#123;if ((appName=="Netscape")&&(parseInt(appVersion)==4)) &#123;
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; &#125;&#125;
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
&#125;
MM_reloadPage(true);
//-->
</script>
</head>



<body bgcolor="#CCCCFF">

<div id="Layer1" style="position:absolute; left:243px; top:93px; width:324px; height:75px; z-index:3"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Verzend 
  nu deze website naar persoon waarvan jij denkt dat hij wel wat hulp kan gebruiken. 
  Vul het e-mail adres in van deze persoon en druk op verzend.</font></div>
<div id="Layer3" style="position:absolute; left:245px; top:203px; width:325px; height:36px; z-index:4"> 
<?php

// Mail function that has to send the mail
//######################################################################### 
if ($ingezonden) &#123;
	if (mail($EMail,$Onderwerp,$Tekst,"From: $Mailvan")) &#123;
		echo ("<b><center><font color="black" size=3> E-mail met succes verzonden</font></center></b>\n");
	&#125;else&#123; echo ("<b><center><font color="black" size=3> E-mail niet met succes verzonden</font></center></b>\n");
   &#125;
&#125;

//#########################################################################
?>


  <div align="center"></div>
  <div align="center"></div>
</div>
<table border="0" width="600" cellspacing="0" cellpadding="1">

  <tr> 

    <td width="7%" height="173">&nbsp; <p>&nbsp;</p>

      <p>&nbsp;</p>

      <p>&nbsp;</p>

      <p>&nbsp;</td>

    <td width="600" valign="top"> <table border="0" width="600" bgcolor="#4E5898" cellspacing="0" cellpadding="0">

        <tr> 

          <td width="100%"><font size="2" face="Verdana" color="#FFFFFF">Verstuur 
            deze website naar iemand</font></td>

        </tr>

      </table>

      <p><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> </a></font></p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <div id="Layer2" style="position:absolute; left:53px; top:59px; width:147px; height:67px; z-index:2"> 
        <form  method="post" action="Verstuur.php">
          <p> 
            <input name="Email" type="text" value="E-mail van persoon">
          </p>
          <p align="center">
		   	<input type="hidden" name="ingezonden" value="true">
            <input type="submit" name="Submit" value="Vernzend">
          </p>
        </form><?php require ("footer.php")?>
      </div>
      <table border="0" width="600" bgcolor="#4E5898" cellspacing="0" cellpadding="0">

        <tr> 

          <td width="100%"><font size="2" face="Verdana">&nbsp;<a href="javascript: history.go(-1)"><font color="#FFFFFF">Terug</font></a></font></td>

        </tr>

      </table></td>

  </tr>

</table>

</body>

</html>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Does it work for you?

Mac
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Post by Skywalker »

No it doesn't work, I think I have to do something with the header or something. But I am not sure. Some advice would be nice. :roll:
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Do you get any error messages? Anything else you can tell us about how the code runs/doesn't run that might help us to help you. Posting 'what's wrong with this' without giving any supporting information won't get you a very good response.

Mac
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Post by Skywalker »

That is the problem, itsn't giving any errors, but It also isn't sending anymail? Why I don't understand. Maybe so of you could tell me?

Thx alot everybody for helping me.
Post Reply