PHP sending email

krofunk

New Member
Messages
216
Reaction score
5
Points
0
Hi, I am trying to make a contact form for my site however I am stuck on something.

My current code works but my email provider puts it in the junk folder (with some providers it didn't show up at all)

Here is my current code
Code:
sending

I am a bit of a PHP newbie so any help would be great!
 

krofunk

New Member
Messages
216
Reaction score
5
Points
0
Ha! Tapatalk doesn't support bb code sorry!

---------- Post added at 01:00 PM ---------- Previous post was at 12:55 PM ----------

[/COLOR]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><META HTTP-EQUIV=Refresh CONTENT="3; URL=http://www.iowbonsai.org.uk/">

<title>sending</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body {
background-image: url(http://www.iowbonsai.org.uk/res/images/bosaibg.png);
background-position:bottom right;
background-repeat:no-repeat;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 24px;
}
html,body,#wrapper{
height:100%;
margin:0;
padding:0;
border:none;
text-align:center
}
</style>
</head>

<body>

<?php
if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['service']) && isset($_POST['message']))
{
$to = "islandphil@live.co.uk";
$subject = "Website Message";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$service = $_POST['service'];
$message = $_POST['message'];
$headers = "MIME-Version: 1.0\n";



$body = "From: " . $name_field . "\n E-Mail: " . $email_field . "\n FAO: " . $service . "\n Additional Info:\n" . $message;
$body = wordwrap($body, 70);

if(mail($to, $subject, $body, $headers))
{
echo "Data has been submitted, Please Wait";
}
else
{
echo "Mail Failed. Contact Webmaster directly on ------PrinceSparkle@gmail.com-------";
}
}
else
{
echo "Oops, please try again later.";
}

?>

</body>
</html>
 
Last edited:

bidzey75

New Member
Messages
53
Reaction score
0
Points
0
your code as nothing to do with it. Email systems knows when an email is sent by a server and by default many put it in the junk folder. Just go to your email acount and tell it it's not junk, then you will recieve it in your inbox.
 
Last edited:

krofunk

New Member
Messages
216
Reaction score
5
Points
0
There is no way for me to sort it server side then? Just out of curiosity. A friend of mine started hammering on about headers, that made no sense though :S
 
Top