Closed Thread
Results 1 to 2 of 2

Thread: how to send a php mail?

  1. #1
    logicours44 is offline x10Hosting Member logicours44 is an unknown quantity at this point
    Join Date
    Mar 2011
    Posts
    1

    how to send a php mail?

    hi,
    I am unable to send a mail via the php function mail(). Is it possible? How?
    my code is

    <?php
    $headers ='From: "nom"<adresse@fai.fr>'."\n";
    $headers .='Reply-To: adresse_de_reponse@fai.fr'."\n";
    $headers .='Content-Type: text/plain; charset="iso-8859-1"'."\n";
    $headers .='Content-Transfer-Encoding: 8bit';

    if(mail('logicours@live.fr', 'Sujet', 'Message de test', $headers))
    {
    echo 'yes';
    }
    else
    {
    echo 'no';
    }
    ?>

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: how to send a php mail?

    PHP Code:
    $from_name="Barefoot" ;
    $from "nonikes@shoeless.x10.bz";
    $to="myaddress@gmail.com";

    $mailbody="test message  sent on: \n" date('l jS \of F Y h:i:s A');
    $subject="test of PHP mail() sending mail." ;

    $headers "Content-type: text/plain; charset=windows-1251 \r\n";
    $headers .= "From: $from_name <$from>\r\n";
    $headers .= "Reply-To: $from\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "X-Mailer: PHP/" phpversion();

    $resp mail($to$subject$mailbody$headers); 
    The above code works on Chopin, a free server.

    If $resp is true, the system has sent it.
    But some email hosts (Hotmail) will bounce it back (check your Webmail for delivery failure notice) or put it in a spam folder.
    Nothing is always absolutely so.

Closed Thread

Similar Threads

  1. PHP Mail send
    By obk-alliance14 in forum Free Hosting
    Replies: 1
    Last Post: 10-30-2010, 01:35 PM
  2. PHP send mail - Unable to send to Yahoo! email addresses
    By royyuuki in forum Programming Help
    Replies: 7
    Last Post: 03-02-2010, 10:09 AM
  3. Send mail as
    By toasteding in forum Free Hosting
    Replies: 3
    Last Post: 02-12-2010, 02:02 PM
  4. Cant send mail in mail client
    By mrbigdownlow in forum Free Hosting
    Replies: 2
    Last Post: 05-31-2008, 08:55 PM
  5. Replies: 3
    Last Post: 12-03-2007, 08:56 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