+ Reply to Thread
Results 1 to 4 of 4

Thread: PHP sending email

  1. #1
    krofunk's Avatar
    krofunk is offline x10 Sophmore krofunk is an unknown quantity at this point
    Join Date
    Jul 2009
    Location
    In your socks
    Posts
    211

    PHP sending email

    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!

    If I helped you out then don't forget to give me rep

  2. #2
    krofunk's Avatar
    krofunk is offline x10 Sophmore krofunk is an unknown quantity at this point
    Join Date
    Jul 2009
    Location
    In your socks
    Posts
    211

    Angry

    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 by krofunk; 05-13-2011 at 08:01 AM.

    If I helped you out then don't forget to give me rep

  3. #3
    bidzey75's Avatar
    bidzey75 is offline x10Hosting Member bidzey75 is an unknown quantity at this point
    Join Date
    Apr 2011
    Posts
    51

    Re: PHP sending email

    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 by bidzey75; 05-13-2011 at 08:59 AM.

  4. #4
    krofunk's Avatar
    krofunk is offline x10 Sophmore krofunk is an unknown quantity at this point
    Join Date
    Jul 2009
    Location
    In your socks
    Posts
    211
    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

    If I helped you out then don't forget to give me rep

+ Reply to Thread

Similar Threads

  1. email sending
    By otap66685 in forum Free Hosting
    Replies: 0
    Last Post: 12-10-2010, 05:00 AM
  2. Replies: 0
    Last Post: 08-12-2010, 11:10 AM
  3. Email Not Sending
    By x jdh x in forum Free Hosting
    Replies: 1
    Last Post: 06-20-2010, 05:51 PM
  4. Email not sending
    By newscape in forum Free Hosting
    Replies: 6
    Last Post: 11-08-2009, 02:13 PM
  5. Sending email with ASP.NET in C#
    By wraithlunati in forum Free Hosting
    Replies: 0
    Last Post: 07-24-2009, 02:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers