Re: foreach array into mail isn´t working
| From: | DL Neil | Date: | Tue, 22 Jan 2002 11:20:20 +0000 |
| Subject: | Re: foreach array into mail isn´t working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81518@lists.php.net to get a copy of this message | ||
Josepablo,
> Hey guys guess what.. the problem is fixed the was that at mailaddr.txt sense
> the e-mails are each on one line each line has \n that crashed when asigning it
> at mail() , ill make a note of this on the manul.. I have included below the
> script iam now using.. what do you guys think?
>
> Josepablo Pérez
>
> ---------------------------------------------
>
> $maildb = file("mailaddr.txt");
>
> foreach ($maildb as $address)
> {
> $addr_format=explode("\n",$address);
> mail($addr_format[0],"$subject", "$message\n", "From: $from\n");
> }
=Classic!
=So busy looking at the mail() that didn't see what was happening before - and my test rig took
data from an
array (no terminating newline chars) and worked happily, but completely side-stepped the real
problem...
=if it works, it's right!
=note for future: don't use files and records, use db fields!
=well done everybody,
=dn