problem with sending table in php mail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

problem with sending table in php mail

Post by adsegzy »

I am having problem with sending a table in php mail.
i have searched for help in google.com and forums, but the reply am getting is as below;

Code: Select all

$message="<table>
/*my content will go here*/
</table>";
or

Code: Select all

$message = '
<html>
<head>
  <title></title>
</head>
<body>
<table>/*my content will go here*/</table>
</body>
</html>
which i tried but it will always show the table codes in the mail, not making the mail look readable.

what else can i do?

regards
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: problem with sending table in php mail

Post by twinedev »

can you paste the code you are using to actually send the mail?

My suggestion would be use phpmailer class, which is set up to handle just about all mailing tasks, includign attachments, HTMl and plain text versions.

Here is more info: http://phpmailer.worxware.com/index.php?pg=phpmailer

To actually download it, you go here:
http://sourceforge.net/projects/phpmail ... %20php5_6/

But note, that you don't want the main file on this page (the big green download), you want the second one on down in the files list labeled "PHPMailer v5.1" This is the main thing (phpmailer.class.php is what you actually need) and it comes with several examples.

-Greg
Post Reply