Re: PEAR mail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Marc Serra <mserra@xxxxxxxx>:
> i'm using Mail PEAR package and i want to send a mail to a recipient and 
> to some other in Cc.
> So i try to add Cc in header but it failed and mail didn't been 
> delivered to Cc. It was only delivered to adress specified in From field.
>
> I use that code :
>
>
>     $hdrs = array(
>                     "From"    => "adresse1@xxxxxxxx",                   
>                     "Cc" => "adresse2@xxxxxxxx"
                                                 ^
Need a comma at the end of that line.

>                     "Subject" => "Tests"
>                     );
>     $mime = new Mail_mime($crlf);   
>     $mime->setHTMLBody(stripslashes($html));
>     $body = $mime->get();
>     $hdrs = $mime->headers($hdrs);
>     $mail =& Mail::factory('smtp',$params);     
>     $mail->send($recipients, $hdrs, $body);

What is $recipients? Is it an array with both adresse1@xxxxxxxx and
adresse2@xxxxxxxx? or a comma-separated string with both addresses?

Those are the two accepted forms for the first argument to the send()
method. The common pitfall I run into is that I forget to add the Cc
and/or Bcc elements to it before sending -- which means they do not get
delivered.

-- 
Matthew Weier O'Phinney           | mailto:matthew@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux