PHP Mail
Is er iemand die ook maar iets ziet wat er fout is aan dit script??
ik heb een pagina toegevoegd aan een nuke site, die mails moet kunnen verzenden. De nuke zelf kan via de Mail() functie mijn vergeten paswoord naar mij mailen dus dat werkt. en volgens hetzelfde principe. Ik heb zelfs al geprobeerd de vars in gewone tekst (mijn mailadres, onderwerp ed..) te veranderen en dan krijg ik nog steeds geen mail. om gek van te worden !
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?
$naam_ontvanger = $_POST['naar'];
$email_ontvanger = $_POST['email'];
$subject = "FAQ suggestion from website";
$bericht = $_POST['naam'].' Has sent you a FAQ submission : \r\n\r\n';
$bericht = nl2br($bericht);
$headers = "From: ".$naam_ontvanger." <".$email_ontvanger.">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Return-Path: Mail-Error <[email protected]>\r\n";
$headers .= "Reply-To: ".$naam_verzender." <".$email_verzender.">\r\n";
$headers .= "Bcc: ".$email_verzender."\r\n";
$result=mail( $email_ontvanger, $subject,$bericht,$headers);
If ($result == 1)
echo '<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#3A70B1"><table width="100%" border="0" cellpadding="1" cellspacing="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#C0C0C0"><table width="100%" border="0" cellspacing="1" cellpadding="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#E1E7ED"><table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td>
<br>
Your question has been submitted. Thank you for your suggestion <br> <br>
</td>
</tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table>
<form>
<p align="center"><input type="button" value="Close Window" onClick="javascript:window.close()"></p>
</form>';
else
echo '<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#3A70B1"><table width="100%" border="0" cellpadding="1" cellspacing="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#C0C0C0"><table width="100%" border="0" cellspacing="1" cellpadding="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#E1E7ED"><table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td>
<br>
There was a problem submitting your message, please try again.. <br><br>
</td>
</tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table>
<form>
<p align="center"><input type="button" value="Close Window" onClick="javascript:window.close()"></p>
</form>';
?>
$naam_ontvanger = $_POST['naar'];
$email_ontvanger = $_POST['email'];
$subject = "FAQ suggestion from website";
$bericht = $_POST['naam'].' Has sent you a FAQ submission : \r\n\r\n';
$bericht = nl2br($bericht);
$headers = "From: ".$naam_ontvanger." <".$email_ontvanger.">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Return-Path: Mail-Error <[email protected]>\r\n";
$headers .= "Reply-To: ".$naam_verzender." <".$email_verzender.">\r\n";
$headers .= "Bcc: ".$email_verzender."\r\n";
$result=mail( $email_ontvanger, $subject,$bericht,$headers);
If ($result == 1)
echo '<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#3A70B1"><table width="100%" border="0" cellpadding="1" cellspacing="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#C0C0C0"><table width="100%" border="0" cellspacing="1" cellpadding="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#E1E7ED"><table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td>
<br>
Your question has been submitted. Thank you for your suggestion <br> <br>
</td>
</tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table>
<form>
<p align="center"><input type="button" value="Close Window" onClick="javascript:window.close()"></p>
</form>';
else
echo '<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#3A70B1"><table width="100%" border="0" cellpadding="1" cellspacing="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#C0C0C0"><table width="100%" border="0" cellspacing="1" cellpadding="0"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td bgcolor="#E1E7ED"><table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td>
<br>
There was a problem submitting your message, please try again.. <br><br>
</td>
</tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table>
<form>
<p align="center"><input type="button" value="Close Window" onClick="javascript:window.close()"></p>
</form>';
?>
Gewijzigd op 01/01/1970 01:00:00 door Bart
Bevat $_POST['email'] wel een waarde?
gebruik PHP mailer, geen headers meer nodig...
Jurgen schreef op 31.10.2007 13:55:
Daar schijnen wat bugs/veiligheidslekken in te zitten, ben zelf op aanraden van anderen overgestapt op Swift Mailer. Werkt erg eenvoudig en bevat alles wat ik nodig heb. html, plaatjes, bijlages, cc, bcc, batch email, etc. etc.gebruik PHP mailer, geen headers meer nodig...