Hi,
I have used this code from link below to send excel file as attachment.
http://www.hotscripts.com/forums/php/22626-php-form-excel-then-send-email-attachment.html
Here is the code I have used:
<?php
ob_start();
?>
<html>
<head><title></title>
</head>
<body>
<body>
<center>
<table>
<tr>
<td>Name:</td><td>My Name</td>
</tr>
<tr>
<td>Address:</td><td>My address</td>
</tr>
<tr>
<td>Gender:</td><td>Female</td>
</tr>
</table>
</body></html>
<?php
$FILE_CONTENTS = ob_get_contents();
ob_clean();
// include the class
include("../includes/classes/class.mailer.php");
$recipient = "[email protected]";
$from = "[email protected]";
// subject
$subject = "Subject of email";
// email message
$message = "
Here goes the message.
";
$myEmail = new EPDEV_Emailer($recipient, $from, $subject);
$myEmail->addText($message);
$myEmail->addFile("my.xls", "application/vnd.ms-excel", $FILE_CONTENTS);
$myEmail->send();
?>
I get excel file in mail but the file does not contain the lines as the normal excel file contains. But i need the file with lines as excel file contains. Can anyone suggest me what the problem might be.
Thanks in advance