PHP mail() function

Discussion in 'HTML / PHP / JavaScript / CSS' started by DAMAN, Apr 13, 2004.

  1. I am new to PHP scripting and using my website to test on a live website before production.

    Is the server's php.ini file setup this way:

    SMTP = mail.yourdomainname.com (i.e. charlotte.com)
    sendmail_from = chosenalias</font id="red">@yourdomainname.com

    TIA
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    The SMTP server is set in the INI file.

    The send from is [email protected]


    quote:Originally posted by DAMAN

    I am new to PHP scripting and using my website to test on a live website before production.

    Is the server's php.ini file setup this way:

    SMTP = mail.yourdomainname.com (i.e. charlotte.com)
    sendmail_from = chosenalias</font id="red">@yourdomainname.com

    TIA
    </blockquote id="quote"></font id="quote">
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    You can change the from address by adding a customized header



    <?php
    $to = "[email protected]";
    $subject = "Test Mail from PHP";
    $out = str_pad("This is a test", 20);
    $header = "From: [email protected]\nReturn-Path: [email protected]\nX-Mailer: PHP/" . phpversion();

    mail($to, $subject, $out, $header);

    exit;

    ?>



    quote:Originally posted by bruce

    The SMTP server is set in the INI file.

    The send from is [email protected]


    quote:Originally posted by DAMAN

    I am new to PHP scripting and using my website to test on a live website before production.

    Is the server's php.ini file setup this way:

    SMTP = mail.yourdomainname.com (i.e. charlotte.com)
    sendmail_from = chosenalias</font id="red">@yourdomainname.com

    TIA
    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
     
  4. Thanks Bruce!
     

Share This Page