Hi All,
I'm creating a script that will generate an email and send a
list of
items to a user. The list of items will be dependent on the
amount
purchased by the user, and the items are retrieved from a
MySql
table.
I retrieve the items (using Pear mdb2) but am having trouble
devising
a correct way of inserting them into the email.
So, if we assume that I have a valid $resultset object that
has 5
rows, what is the best way to get those items into an email,
in both a
text and an html format?
$text = "The email with the items.... ";
$html = "<html><body><p>The email
with the items.....</p></body></
html>";
$crlf = "n";
$hdrs = array(
'From' => 'Somebody <somebody email.com>',
'Subject' => 'This is the subject.'
);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
if ($mail->send('myemail email.com', $hdrs, $body))
{
echo "<p><b>I was able to send the
e-mail...I think.</b>";
}
else
{
echo "<p><b>Sorry, an error must have
occurred. Please try again.</
b></p>";
}
// free the statement
$statement->Free();
Thanks in advance....Jamie
--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.
For information or project assistance please visit :
http://www.360psg.com
You received this message because you are subscribed to the
Google Groups "Professional PHP Developers"
group.
To post to this group, send email to Professional-PHP googlegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribe googlegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---
|