Email with PHP problem.....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eekabob
    New Member
    • Mar 2007
    • 5

    Email with PHP problem.....

    I'm a newbie......... ...trying to send an Cc email a customer who fills out a quote request form but can't fiqure out how to do it.........

    I have this code...

    $headers .= "Cc: I want this to be a variable";

    How would I use a variable for the CC?



    eekabob
  • federicog
    New Member
    • Mar 2007
    • 30

    #2
    [PHP]$headers .= "Cc: ".$email;[/PHP]

    Of course, $email should contain the e-mail address you want to send the copy to.
    Either way, I strongly recommend you use PHPMailer class to send e-mails and let it do all the dirty work (such as creating e-mail headers).

    Good Luck!

    Comment

    • eekabob
      New Member
      • Mar 2007
      • 5

      #3
      Originally posted by federicog
      [PHP]$headers .= "Cc: ".$email;[/PHP]

      Of course, $email should contain the e-mail address you want to send the copy to.
      Either way, I strongly recommend you use PHPMailer class to send e-mails and let it do all the dirty work (such as creating e-mail headers).

      Good Luck!





      Thanks for your help!!

      Comment

      • eekabob
        New Member
        • Mar 2007
        • 5

        #4
        That didn't work.......here is my code...

        <?php
        $headers = 'From: quotes@usstuff. com' . "\r\n";
        $headers*.=*'Cc :*'.$emailadd." \r\n";


        $message = $company."\n"." \n".$firstname. " ".$lastname."\n "."\n". $telephonenum." ext:".$exten."\ n"."\n".$emaila dd."\n"."\n"."Q uantities"."\n" ."\n".$quan1 ." ".$quan2." ".$quan3." ".$quan4."\n"." \n".$stock."\n" ."\n"."Front Colors"."\n"."\ n".$frontcolo1. "\n"."\n".$fron tcolo2."\n"."\n ".$frontcolo3." \n"."\n".$front colo4."\n"."\n" .$frontcolo5."\ n"."\n".$frontc olo6."\n"."\n". "Back Colors"."\n"."\ n".$backcolo1." \n"."\n".$backc olo2."\n"."\n". $backcolo3."\n" ."\n".$backcolo 4."\n"."\n".$ba ckcolo5."\n"."\ n".$backcolo 6;



        mail("quotes@us stuff","Quote Request",$messa ge,$headers);
        ?>

        Comment

        • eekabob
          New Member
          • Mar 2007
          • 5

          #5
          Originally posted by federicog
          [PHP]$headers .= "Cc: ".$email;[/PHP]

          Of course, $email should contain the e-mail address you want to send the copy to.
          Either way, I strongly recommend you use PHPMailer class to send e-mails and let it do all the dirty work (such as creating e-mail headers).

          Good Luck!

          That didn't work....I put my code in a reply....

          Comment

          • federicog
            New Member
            • Mar 2007
            • 30

            #6
            [PHP]$headers*.=*'Cc :*'.$emailadd." \r\n";[/PHP]

            You should remove the asterisks in the string, why are they there?

            [PHP]$headers.= 'Cc:'.$emailadd ."\r\n";[/PHP]

            Comment

            • eekabob
              New Member
              • Mar 2007
              • 5

              #7
              Originally posted by federicog
              [PHP]$headers*.=*'Cc :*'.$emailadd." \r\n";[/PHP]

              You should remove the asterisks in the string, why are they there?

              [PHP]$headers.= 'Cc:'.$emailadd ."\r\n";[/PHP]


              Must have been the cut paste that put them there.......... .ok I tried your code and it still didn't work....here is the error I'm getting

              Parse error: parse error, unexpected T_CONSTANT_ENCA PSED_STRING in /home/printing/bradleypressusa-www/phpquote.php on line 3

              Here is my code without the asteriks...

              <?php
              $headers = 'From: quotes@usstuff' . "\r\n";
              $headers.=*'Cc: '.$emailadd."\r \n";


              $message = $company."\n"." \n".$firstname. " ".$lastname."\n "."\n".$telepho nenum." ext:".$exten."\ n"."\n".$emaila dd."\n"."\n"."Q uantities"."\n" ."\n".$quan1 ." ".$quan2." ".$quan3." ".$quan4."\n"." \n".$stock."\n" ."\n"."Front Colors"."\n"."\ n".$frontcolo1. "\n"."\n".$fron tcolo2."\n"."\n ".$frontcolo3." \n"."\n".$front colo4."\n"."\n" .$frontcolo5."\ n"."\n".$frontc olo6."\n"."\n". "Back Colors"."\n"."\ n".$backcolo1." \n"."\n".$backc olo2."\n"."\n". $backcolo3."\n" ."\n".$backcolo 4."\n"."\n".$ba ckcolo5."\n"."\ n".$backcolo 6;



              mail("me@usstuf f.com","Quote Request",$messa ge,$headers);
              ?>

              Comment

              Working...