+ Reply to Thread
Results 1 to 5 of 5

Thread: PHP Mail() function problem?

  1. #1
    john s is offline Junior Member john s is on a distinguished road
    Join Date
    May 2007
    Posts
    6

    Default PHP Mail() function problem?

    I have been trying to use the php mail() function to send details from an HTML form. Trouble is that it just wont work! It says it is working and is sending the mail, but I have never recieved any mail! Tried it with several email accounts and a couple of web hosting accounts. Any ideas?

  2. #2
    eclipseagent is offline Junior Member eclipseagent is on a distinguished road
    Join Date
    May 2007
    Posts
    1

    Default

    And you don't provide us your code? Would something like that fo ryou work?

  3. #3
    spl
    spl is offline Junior Member spl is on a distinguished road
    Join Date
    May 2007
    Posts
    1

    Default

    It's probably a PHP configuration problem. You'll need to contact the web host to ensure you can send SMTP mail from their server using PHP.Additionally, you don't specific the code you're using but you may want to try adding header information if you're using a Windows server.PHP mail function: http://us2.php.net/manual/en/ref.mail.php

  4. #4
    drixie is offline Member drixie is on a distinguished road
    Join Date
    Apr 2007
    Posts
    69

    Default

    Lets see the code you are using. it sure is a problem with the code if you have tried different web hosting accounts. but ideally, the php mail() funcion should follow basically the following format: mail(address, subject, message). Please crosscheck your code. If it is still not working. paste it here

  5. #5
    bokepwap is offline Junior Member bokepwap is on a distinguished road
    Join Date
    Jun 2008
    Posts
    14

    Default

    This code the sample of php mail spamm..
    this script not recomended
    PHP Code:
    <?php
    // PHP Mail Spam v.2 Beta
    // Created by Imzers Crew [BugCLones and nababan]
    // Info and Support: http://wap.imzers.us
    $email $_POST['to'];
    $mail_message $_POST['message'];
    $senders_name $_POST['name'];
    $senders_email $_POST['email'];
    $mail_subject $_POST['subject'];

    $senders_name preg_replace("/[^a-zA-Z0-9s]/"" "$senders_name);
    $senders_email preg_replace("/[^a-zA-Z0-9s.@-_]/"" "$senders_email);
    $mail_message stripslashes($mail_message);
    $headers "From: $senders_name <$senders_email>
    "
    ;
    $headers .= "Hallo...

    "
    ;
    $jumlah $_POST['jumlah'];
    $i=0;
    if (
    $_SERVER["REQUEST_METHOD"]=="POST")
    {
    if (
    $jumlah 2)
    {
    $mail_subject++;
    $mail_subject $mail_subject++;
    }

    {
    do
    {
    $i++;
    mail($email$mail_subject$mail_message$headers);
    }
    while (
    $i $jumlah);
    echo 
    "email was sent sebanyak $jumlah!<br/>";
    exit;
    }

    }
    echo 
    "<form action="{$_SERVER["PHP_SELF"]}dan" method="post">";
    echo 
    "Dari Nama:<br/>
    "
    ;
    echo 
    "<input type="text" name="name" size="40" /><br/>
    "
    ;
    echo 
    "Dari Email:<br/>
    "
    ;
    echo 
    "<input type="text" name="email" size="40" /><br/>
    "
    ;
    echo 
    "Kepada:<br/>
    "
    ;
    echo 
    "<input type="text" name="to" size="40" /><br/>
    "
    ;
    echo 
    "Judul:<br/>
    "
    ;
    echo 
    "<input type="text" name="subject" size="40" /><br/>
    "
    ;
    echo 
    "<br/>Message:<br/><textarea name="message" rows="20" cols="40"></textarea><br/>
    "
    ;
    echo 
    "<br/>Jumlah:<br/>
    "
    ;
    echo 
    "<input type="text" name="jumlah" size="12" />
    "
    ;
    echo 
    "<br/>
    "
    ;
    echo 
    "<input type="submit" value="Kirim!" name="post" />
    "
    ;
    echo 
    "</form>
    "
    ;
    ?>

+ Reply to Thread

Similar Threads

  1. JavaScript Math() function problem?
    By adamtollett2006 in forum Javascript
    Replies: 1
    Last Post: 01-19-2010, 02:03 AM
  2. Replies: 3
    Last Post: 12-16-2009, 06:48 AM
  3. Mail function Dosent Work in my Account
    By Apurbo in forum Web Hosting Support
    Replies: 1
    Last Post: 09-26-2008, 03:38 AM
  4. Mail Problem
    By renjer in forum Web Hosting Support
    Replies: 1
    Last Post: 01-09-2008, 08:53 PM
  5. php mail function
    By mbooks in forum Programming / Scripting / Coding Forum
    Replies: 1
    Last Post: 01-28-2007, 04:00 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