Re: problem figuring out why mail fails
Kristall <[email protected]> Mon, 27 Feb 2023 02:40:40 -0800 (PST)
| Newsgroups | comp.lang.php |
|---|---|
| Message-ID | <[email protected]> |
Aitaksite mind natuke rahaga ? Asun Männimäe 27-39, Viljandi, EESTI RIIK. Telefon: (+372) 56091196 On Wednesday, April 14, 2021 at 6:58:30 PM UTC+2, Jerry Stuckle wrote: > On 4/14/2021 10:32 AM, Arno Welzel wrote: > > bill: > > > >> I have a script that sends mail in a loop. Unfortunately it is > >> sending only the first. > >> Mail returns "false" for all sends after the first: > >> > >> Here is the script segment: > >> > >> $to ='[email protected]'; > >> $subject ='IRWOM Status Update request'; > >> > >> $headers[] = 'MIME-Version: 1.0'; > >> $headers[] = 'Content-type: text/html; charset=iso-8859-1'; > >> $headers[] = 'From: [email protected]'; > > > > If you do this in a loop you all ADD headers with every loop cycle. > > > > Better do this: > > > > $headers = [ > > 'MIME-Version: 1.0', > > 'Content-type: text/html; charset=iso-8859-1', > > 'From: [email protected]', > > ]; > > > Or, since he's not changing the headers, just set $headers once before > entering the loop. The same with $subject if that doesn't change. > > -- > ================== > Remove the "x" from my email address > Jerry Stuckle > [email protected] > ==================