Re: stumped-mail and database

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

 



--- Stuart Felenstein <stuart4m@xxxxxxxxx> wrote:

> 
> --- Jason Wong <php-db@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxx\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

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux