mail function

Discussion in 'PHP' started by DmitryS, Mar 3, 2011.

  1. #1
    How do I include .$email to the mail function.

    this is my current code:
    mail($to, $subject, "", $headers);

    I want do it like this;
    mail("me@myweb.com".$email, $subject, "", $headers);

    Thanks
     
    DmitryS, Mar 3, 2011 IP
  2. w3whizz

    w3whizz Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hi,

    if you want to send email to more than one person use 'CC' in headers.

    CODE :

    <?php
    $to = "me@myweb.com";
    $subject = "My subject";
    $txt = "Hello world!";
    $headers = "From: webmaster@myweb.com" . "\r\n" .
    "CC: somebodyelse@example.com";

    mail($to,$subject,$txt,$headers);
    ?>

    If you have any query let me know.

    Thanks,
     
    w3whizz, Mar 3, 2011 IP