[PHP] Re: Can this be done with mail()?

2002-07-14 Thread Richard Lynch


I need to query a database and return a resultset. A php script will then 
sort through the data and send the data to the browser in the form of a table.

Is it possible to gather the the results with html tags and store them in a 
variable so that the results can be emailed to someone? If so, how would 
this be done?

Do as much of the sorting/searching in SQL as you can.  MUCH faster.

Use the mail class from http://phpclasses.org to do the html-enhanced email.

WARNING:  Many readers will simply *TRASH* your enhanced email.  Re-think
your priorities.

Collecting your HTML in a variable is easy:

?php
  $html = '';
  # Get db stuff
  $html .= TABLE\n;
  # Loop through results{
$html .= TRTD$x/TDTD$y/TDTD$z/TD/TR\n;
  }
  $html .= /TABLE\n;
?

It's just like doing everything with echo, only not. :-)

You may want to echo some stuff out as well, so you know what's happening...

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Can this be done with mail()?

2002-07-13 Thread Peter

Yes. I'm sure you could just mail out the table in an email. You'd have to
do it as a multipart email (i think that's what it's called) as just mailing
out the html code wouldn't show as a table in a mail client.
Here's the source of a HTML spam I got this morning - should give you an
idea how to do it.  Note: you still mail out using the mail() function.

Received: from xmail02.nationala-1advertising.com ([208.236.10.104]) by
mc2-f11.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905);
  Sat, 13 Jul 2002 02:38:25 -0700
Received: (qmail 22574 invoked from network); 12 Jul 2002 23:51:55 -
Received: from unknown (HELO CAMPAIGN) (208.236.10.4)
  by 0 with SMTP; 12 Jul 2002 23:51:55 -
From: AccuLotto [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: WIN $10,000 in 6 months - Guaranteed! [EMAIL PROTECTED]
Date: Fri, 12 Jul 2002 19:54:23 -0700
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=Boundary..
Return-Path: [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
X-OriginalArrivalTime: 13 Jul 2002 09:38:25.0416 (UTC)
FILETIME=[09287880:01C22A51]

--Boundary..
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

This message can only be viewed in HTML

--Boundary..
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

HTMLHEADTITLE/TITLE/HEAD

BODY
CENTER
A HREF=http://www.acculotto.com/p.pl/M2; TARGET=_blank

IMG SRC=http://208.236.11.23/custom/acculotto/images/acculotto.gif;
BORDER=0/A
/CENTER

p
center
font face=Verdana, Arial, Helvetica, sans-serif size=1If the above
links
do not work or appear, simply copy this URL and paste it into your browser's
address field:br /fontfont face=Verdana, Arial, Helvetica, sans-serif
size=1 color=#FF
a href=http://www.acculotto.com/p.pl/M2; TARGET=_blank
http://www.acculotto.com/p.pl/M2/a/fontbrbrbr/center
HR SIZE=1 width=90%
p

p align=justifyfont size=-2

Note: This email was sent to you because you registered at Free.com and
subscribed to this newsletter. The email address was then verified and the
agreement confirmed by someone responding from your email address that
required confirmation of registration. This is a double opt-in list and can
NOT in any way be construed as spam. If you wish to unsubscribe from
Free.com, please click the link below:br
a href=http://www.Free.com/OptOut.asp?o=227825;Unsubscribe Here/abr
and you will never receive another wonderful, free offer from us! Please
note, it may take up to a week for you to be removed from our database.br
hr
/body
/html


--Boundary..--




Manuel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I need to query a database and return a resultset. A php script will then
sort through the data and send the data to the browser in the form of a
table.

 Is it possible to gather the the results with html tags and store them in
a variable so that the results can be emailed to someone? If so, how would
this be done?



 -
 Do You Yahoo!?
 Yahoo! Autos - Get free new car price quotes



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