Re: Sending a Table Via mail

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

 



Great thanks! Sorry I didn't realise it was in there.

what I've got so far is the following, I want to include a variable in there
but have tried different combos but can't get it to work reading the
variable.



$to = add@xxxxxxxxxxxx

# subject of message
$re = "Test Email from system";
$tablecontent = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01
Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'><html><head><title>Untitled
Document</title></head><body><TABLE><TR><TD>hello</td></TR></TABLE></body></
html>";
#message from the form
$msg = $tablecontent;

$message = '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
   <tr>
     <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
   </tr>
   <tr>
     <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
   </tr>
<TR>
<TD>"$username"</TD>
</TR>

  </table>
</body>
</html>
';



// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";



# send the mail now
mail($to, $re, $message,$headers);
########### MAIL ENDS HERE
?>



----- Original Message -----
From: "John Nichel" <john@xxxxxxxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Wednesday, March 23, 2005 9:37 PM
Subject: Re:  Sending a Table Via mail


> PartyPosters wrote:
> > Hello is there any way I can send a table (or just tabulated data) via
email.
> > I've tried this but comes up with an error.
> > $to = myemail@xxxxxxxxxxx;
> >
> > $re = "Test Email from system";
> >
> > $msg = "<TABLE BORDER=\"2\"><TR>hello</TR></TABLE>"
> >
> >
> > mail($to, $re, $msg);
>
> It's in the manual...
>
> http://us4.php.net/manual/en/function.mail.php
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john@xxxxxxxxxxxx
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux