Op deze website gebruiken we cookies om content en advertenties te personaliseren, om functies voor social media te bieden en om ons websiteverkeer te analyseren. Ook delen we informatie over uw gebruik van onze site met onze partners voor social media, adverteren en analyse. Deze partners kunnen deze gegevens combineren met andere informatie die u aan ze heeft verstrekt of die ze hebben verzameld op basis van uw gebruik van hun services. Meer informatie.

Akkoord

Vraag & Antwoord

Webprogrammeren & scripting

Hulp bij mailform

None
3 antwoorden
  • 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, " . "

    " . $naam . "\t". "(". $emailadres . ")". "heeft op" . "\t" . $datum . "\t" . "om". "\t" . $tijd . "\t". "de volgende gegevens ingestuurd:" . "

    " . "Wedstrijddatum: \t" . $dag . - $maand . - $jaar . "
    " . "Wedstrijdnummer: \t" . $wedstrijdnummer. "
    " . "Team: \t \t \t \t" .$team1 . "\t" . "tegen Team: \t " . $team2 . "
    ". "
    " . "Setstanden: \t \t " . "Voor \t \t \t tegen". "
    " . "
    " . "Set 1: \t \t \t \t" . $set1. "\t \t \t" . $set1a . "
    " . "Set 2: \t \t \t \t". $set2 . "\t \t \t " . $set2a . "
    ". "Set 3: \t \t \t \t". $set3 . "\t \t \t " . $set3a . "
    " . "Set 4: \t \t \t \t" . $set4 . "\t \t \t " . $set4a . "
    " . "Set 5: \t \t \t \t " . $set5 . "\t \t \t " . $set5a . "
    ". "
    " . "Eventuele opmerkingen van de gebruiker: " . "

    " . $opmerkingen ;

    //alle headers die ervoor zorgen dat mogelijke problemen voorkomen worden
    $headers = "MIME-Version: 1.0
    ";
    $headers .= "Content-type: text/plain; charset=iso-8859-1
    ";
    $headers .= "X-Priority: 3
    ";
    $headers .= "X-MSMail-Priority: Normal
    ";
    $headers .= "X-Mailer: php
    ";
    $headers .= "From: \"".$fromName."\" <".$fromEmail.">
    ";

    //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]























  • 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.
  • [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]

Beantwoord deze vraag

Dit is een gearchiveerde pagina. Antwoorden is niet meer mogelijk.