Results 1 to 3 of 3

Thread: send contact us form to email

  1. #1
    Join Date
    Jun 2006
    Location
    na
    Posts
    5
    Rep Power
    0

    send contact us form to email

    hi there! i need help from all of u about my problem...

    my problem is, i need to send data from contact us form to email... but till now my coding tak menjadiiiiii!!! why? can u all tell me why?? plzzz...

    the problem is, all the data success send but not to email. is that about the server? is that my server block the mail() function?

    this is my coding :

    <?php

    $errmsg = ''; // error message
    $sname = ''; // sender's name
    $email = ''; // sender's email addres
    $subject = ''; // message subject
    $message = ''; // the message itself

    if(isset($_POST['send']))
    {
    $sname = $_POST['sname'];
    $email = $_POST['email'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];

    if(trim($sname) == '')
    {
    $errmsg = 'Please enter your name';
    }
    else if(trim($email) == '')
    {
    $errmsg = 'Please enter your email address';
    }
    else if(!isEmail($email))
    {
    $errmsg = 'Your email address is not valid';
    }
    else if(trim($subject) == '')
    {
    $errmsg = 'Please enter message subject';
    }
    else if(trim($message) == '')
    {
    $errmsg = 'Please enter your message';
    }

    if($errmsg == '')
    {
    if(get_magic_quotes_gpc())
    {
    $subject = stripslashes($subject);
    $message = stripslashes($message);
    }

    // the email will be sent here
    $to = "nanazack@yahoo.com";

    // the email subject
    $subject = '[Contact] : ' . $subject;

    // the mail message ( add any additional information if you want )
    $msg = "From : $sname \r\n " . $message;

    mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n");

    ?>

  2. #2
    Join Date
    Jan 2007
    Location
    Petaling Jaya
    Posts
    867
    Rep Power
    167
    since u said ur data is successfully sent. from my guess is ur mail(), y not try to store the whole 4th parameter to a variable instead of putting the whole expression there? mayb tat cause the problem? i m not sure also coz i seldom deal with mail(), but js try and out and also simplify the code a but

  3. #3
    Join Date
    Jul 2006
    Location
    LittlePenang.com
    Posts
    1,778
    Rep Power
    191
    u are using free hosting or paid hosting.
    mostly free hosting disable the mail ()...
    I blog IT Engineer LIFE at iCalvyn.com

    DreamNetwork If you don't mind Pirated

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Contact Management
    By sallehy in forum Other Internet Marketing Methods
    Replies: 0
    Last Post: 17-10-2009, 01:05 AM
  2. Replies: 3
    Last Post: 30-01-2009, 12:01 PM
  3. My Qip Not Have contact list
    By DuccickinfulK in forum Blogging Discussion
    Replies: 0
    Last Post: 10-12-2008, 06:14 PM
  4. how to send email through asp?
    By pepsi_blue in forum Website Programming
    Replies: 5
    Last Post: 28-06-2007, 11:55 PM
  5. send form script
    By alvinhan in forum Website Programming
    Replies: 8
    Last Post: 05-05-2002, 01:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

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 36 37