Jump to content

Email Injections?


BryantA

Recommended Posts

Hi,

 

I'm very new to PHP so I'm not sure if this is right but I'm trying to find out if the code below is safe from email injections. I intentionally left out the request for an email because it's not needed for my purpose but I'm not sure if I'm safe. Help please!

 

This is the HTML

<form method="post" action="contact.php"> 
Sugesstion:<br> 
<input type="text" name="message" rows="15" cols="40">
<input value="Submit" type="submit"> 
</form> 

 

This is the PHP

<?php 
$to = "[email protected]"; 
$subject = "Suggestion"; 
$message = $_REQUEST['message'] ; 
$sent = mail($to, $subject, $message) ; 
if($sent) 
{print "Your mail was sent successfully"; }
else 
{print "We encountered an error sending your suggestion"; }
?> 

Link to comment
https://forums.phpfreaks.com/topic/264912-email-injections/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.