Results 1 to 4 of 4

Thread: mail function from php

  1. #1
    Join Date
    Dec 2008
    Location
    Montevideo, Uruguay
    Posts
    454

    Question mail function from php

    Hi there,

    I'm trying to use the mail function from php. At this point I am sending them (the mails) to my e-mail accounts.

    I run the program but nothing happens. Any suggestion ? IS apache has something to do with this ?

    I copy-paste my simple program of mail:


    <html>
    <head>
    <title>Correos</title>
    </head>
    <body>
    <?php
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $mail = "*****@***.**"; //I don't write for spam reasons, but the mail account is right

    for ($i=1;$i<=5;$i++){
    mail($mail,'Test','5 mails to the same e-mail box', $headers);
    echo "Sending mail number $i <br> \n ";
    }
    ?>
    </body>
    </html>


    Thanks for help

    Best regards

    agunet74
    agunet74

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: mail function from php

    See here: PHP mail() Function which says about the headers argument:

    Note: When sending an email, it must contain a From header. This can be set with this parameter or in the php.ini file.al.

  3. #3
    Join Date
    Dec 2008
    Location
    Montevideo, Uruguay
    Posts
    454

    Default Re: mail function from php

    I copy those headers arguments, add the from to php ini and still not working.

    in the program if I write it in the headers variable, like this:

    headers = "******@****.***" . "\r\n";
    heraders .= "charset.. and other sutff I copied literall

    I don't know.. bou it's not working

    Thanks anyway

    any other help will be very welcome!

    agunet74
    agunet74

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: mail function from php

    Here's a call from a webapp I wrote:

    mail($to, $subject, $message, 'From: ' . REPLY_TO . "\r\n" . 'Reply-To: ' . DO_NOT_REPLY . "\r\n" . 'Content-type: text/plain; charset="utf-8"');
    REPLY_TO and DO_NOT_REPLY are constants in my webapp, set to the appropriate mail addresses for the webapp.

Tags for this Thread

Posting Permissions

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