Ga naar inhoud

Hulp bij mailform


anoniem

Aanbevolen berichten

Hallo, Ik heb een mailform gemaakt en naar mijn weten kloppen alle gegevens, toch krijg ik geen bevestiging dat het formulier verstuurd is, in mijn mailbox verschijnt ook geen inzending. Kan iemand mij hiermee helpen? Heel erg bedankt alvast! groeten, Bas van Vliet Hier is het script: [code:1:a142247821] <html> <head> <title>Uitslagen opsturen</title> </head> <body> <form name="form1" method="post" action="formulier.php"> <table width="83%" height="586" border="0"> <tr> <th width="24%" scope="row"><div align="left">Naam: </div></th> <td width="26%"><input name="naam" type="text" size="30"></td> <td width="14%">&nbsp;</td> <td width="16%">&nbsp;</td> <td width="14%">&nbsp;</td> <td width="6%">&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Emailadres: </div></th> <td><input name="emailadres" type="text" size="30"></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Wedstrijddatum: </div></th> <td><SELECT NAME="dag"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> <OPTION>8</OPTION> <OPTION>9</OPTION> <OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION> <OPTION>13</OPTION> <OPTION>14</OPTION> <OPTION>15</OPTION> <OPTION>16</OPTION> <OPTION>17</OPTION> <OPTION>18</OPTION> <OPTION>19</OPTION> <OPTION>20</OPTION> <OPTION>21</OPTION> <OPTION>22</OPTION> <OPTION>23</OPTION> <OPTION>24</OPTION> <OPTION>25</OPTION> <OPTION>27</OPTION> <OPTION>28</OPTION> <OPTION>29</OPTION> <OPTION>30</OPTION> <OPTION>31</OPTION> </SELECT> - <SELECT NAME="maand"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> <OPTION>8</OPTION> <OPTION>9</OPTION> <OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION></SELECT> - <select name="jaar"> <option selected></option> <option>2005</option> <option>2006</option> </select></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Wedstrijdnummer: </div></th> <td><INPUT TYPE="text" NAME="wedstrijdnummer" SIZE="4" MAXLENGTH="4"></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Teamnummer: </div></th> <td><SELECT NAME="team1"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> <OPTION>8</OPTION> <OPTION>9</OPTION> <OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION></SELECT> Tegen: <SELECT NAME="team2"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> <OPTION>8</OPTION> <OPTION>9</OPTION> <OPTION>10</OPTION> <OPTION>11</OPTION> <OPTION>12</OPTION></SELECT><br><br></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Setstanden: <BR> </div></th> <td>Voor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tegen </td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Set 1: </div></th> <td><SELECT NAME="set1"><OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <SELECT NAME="set1a"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Set 2: </div></th> <td><SELECT NAME="set2"><OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <SELECT NAME="set2a"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Set 3: </div></th> <td><SELECT NAME="set3"><OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <SELECT NAME="set3a"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Set 4 : </div></th> <td><SELECT NAME="set4"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <SELECT NAME="set4a"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Set 5: </div></th> <td><SELECT NAME="set5"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <SELECT NAME="set5a"> <OPTION selected></OPTION> <OPTION>1</OPTION> <OPTION>2</OPTION> <OPTION>3</OPTION> <OPTION>4</OPTION> <OPTION>5</OPTION> <OPTION>6</OPTION> <OPTION>7</OPTION> </SELECT></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left">Opmerkingen: </div></th> <td><textarea name="opmerkingen" cols="40" rows="3">Eventuele opmerkingen...</textarea></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <HR><tr><td> <input name="datum" type="hidden" id="datum" value="<?php echo(date("d-m-Y"));?>"> <input name="tijd" type="hidden" id="tijd" value="<?php echo(date("H:i:s"));?>"> <input name="cmdSend" type="submit" value="Verzenden"> <input name="Reset" type="reset" id="Reset" value="Leegmaken"> </form></td></tr></table> <?php $fromName = "Ingestuurde Uitslagen"; // Naam voor de headers $fromEmail = "email@adres.nl"; // Adres waar je naar wilt verzenden, tevens voor de headers if (isset($action)) { $naam = $_POST['naam'] ; $emailadres = $_POST['emailadres'] ; $dag = $_POST['dag'] ; $maand = $_POST['maand']; $jaar = $_POST['jaar']; $wedstrijdnummer = $_POST['wedstrijdnummer']; $team1 = $_POST['team1']; $team2 = $_POST['team2']; $set1 = $_POST['set1']; $set1a = $_POST['set1a']; $set2 = $_POST['set2']; $set2a = $_POST['set2a']; $set3 = $_POST['set3']; $set3a = $_POST['set3a']; $set4 = $_POST['set4']; $set4a = $_POST['set4a']; $set5 = $_POST['set5']; $set5a = $_POST['set5a']; $datum = $_POST['datum']; $datum = $_POST['opmerkingen']; $tijd = $_POST['tijd']; $onderwerp = 'Ingestuurde Uitslagen'; $msgBody = "Hallo Ton, " . "\n \n" . $naam . "\t". "(". $emailadres . ")". "heeft op" . "\t" . $datum . "\t" . "om". "\t" . $tijd . "\t". "de volgende gegevens ingestuurd:" . "\n \n" . "Wedstrijddatum: \t" . $dag . - $maand . - $jaar . "\n" . "Wedstrijdnummer: \t" . $wedstrijdnummer. "\n" . "Team: \t \t \t \t" .$team1 . "\t" . "tegen Team: \t " . $team2 . "\n". "\n" . "Setstanden: \t \t " . "Voor \t \t \t tegen". "\n" . "\n" . "Set 1: \t \t \t \t" . $set1. "\t \t \t" . $set1a . "\n" . "Set 2: \t \t \t \t". $set2 . "\t \t \t " . $set2a . "\n". "Set 3: \t \t \t \t". $set3 . "\t \t \t " . $set3a . "\n" . "Set 4: \t \t \t \t" . $set4 . "\t \t \t " . $set4a . "\n" . "Set 5: \t \t \t \t " . $set5 . "\t \t \t " . $set5a . "\n". "\n" . "Eventuele opmerkingen van de gebruiker: " . "\n \n" . $opmerkingen ; //alle headers die ervoor zorgen dat mogelijke problemen voorkomen worden $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: php\n"; $headers .= "From: \"".$fromName."\" <".$fromEmail.">\n"; //het daadwerkelijk verzenden van de mail $send = mail($fromEmail, $onderwerp, $msgBody); if($send){ echo "Uw bericht is verzonden. U krijgt zo spoedig mogelijk bericht."; } else { echo "Het verzenden is mislukt. Verstuur Uw mail handmatig naar email@adres.nl"; } } else{ //dan doe je lekker helemaal niks! } ?> </body> </HTML>[/code:1:a142247821]
Link naar reactie
verander if (isset($action)) in if (isset(POST['cmdSend'])) of zoek een formulier dat wel werkt. Er zijn er zoveel te vinden... NB Je host moet wel php ondersteunen, en de mail-funcite moet niet toevallig uitgeschakeld zijn. Dat is iig het geval bij Lycos. Als je een mailtje probeert te verzenden vanuit een lokale server op een windows-machien wil t ook wel s niet lukken. Je moet dan eerst een mailserver installeren en werkend zien te krijgen.
Link naar reactie
[code:1:6ab3906e33]$send = mail($fromEmail, $onderwerp, $msgBody); [/code:1:6ab3906e33] Je bent je headers vergeten toe te voegen aan het einde :wink: Mail(); heeft 4 parameters in de basis functie... en je maakt de headers wel mooi aan maar je stuurt ze niet mee :P [code:1:6ab3906e33]$send = mail($fromEmail, $onderwerp, $msgBody, $headers); [/code:1:6ab3906e33]
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

  • Populaire leden

    Er is nog niemand die deze week reputatie heeft ontvangen.

  • Leden

    Geen leden om te tonen

×
×
  • Nieuwe aanmaken...