Re: stumped-mail and database

From: Date: Wed, 08 Dec 2004 21:58:52 +0000
Subject: Re: stumped-mail and database
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-37646@lists.php.net to get a copy of this message
--- Stuart Felenstein <stuart4m@yahoo.com> wrote: > > --- Jason Wong <php-db@gremlins.biz> wrote: > > > > > Also just to be certain that you *are* running > those > > lines of code change the > > echo $to, to echo "Before $to" & echo "After $to" > or > > something. > > Some may remember my problem the other day where I was trying to create a mail() block using fields from the database. Finally figured out my problem. Basically I needed to declare the recordset / resultset as a global and move it further up in the script. Things are working way better except I still have one issue. One field is coming from a TEXT column (mysql) I know there is new line formatting in the text. I can't get it to send in the email as the body remains blank. I can do both a print_r and echo and it is fine (except the new lines dissapear) I wonder if it's becasue it's a text column that I am having this problem. global $rsVendorJobs; global $rsRes; global $rsCL; $to = $rsVendorJobs->Fields('Conmail'); $subject = $rsVendorJobs->Fields('RefEm'); $body = $rsCL->Fields('LurkCovLet'); $headers = "From: admin@mysite.com.com\n"; mail($to,$subject,$body,$headers); The field that comes up blank in the email is the $body line. I've tried double quotes in various places. Wonder if I'm missing something ? Thank you Stuart

« previous php.db (#37646) next »