Re: foreach array into mail isn´t working

From: Date: Tue, 22 Jan 2002 02:15:30 +0000
Subject: Re: foreach array into mail isn´t working
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-81473@lists.php.net to get a copy of this message
Blank lines are important to the parsing of mail messages. File does not strip newlines. Try your code and strip the newlines off the email addresses. If you still have problems try it and drop the newlines from the subject. Ken Gregg Enhanced Data Systems, Inc. http://www.rwre.com for the best in Southwest Oregon Real Estate "Josepablo PéRez" wrote: > Hello people, > > I got this script: > > <? > $maildb = file("mailaddr.txt"); > > foreach ($maildb as $address) > { mail($address, "THis is the subject\n", "This is the message\n", > "From: josepablo@net.co.cr\n"); } > ?> > > The mailaddr.txt looks like: > > addr1@server.net > addr2@server.net > addr3@server.net > > However the script does send mails BUT they look like this: > > From Nobody <Root@myserver.net> > To addr1@server.net > Subject [No Subject] > > **From here down is the message body*** > > Subject THis is the subject > From: josepablo@correo.co.cr > > This is the message > > Anybody have an idea why?? I tried it on 2 servers running PHP4 doesnt work, however i also > tried using the mail(...) i used up there but alone and that does work.. so the array is screwing > something up.. > > Josepablo Pérez >

« previous php.general (#81473) next »