(I posted this on the General forum by mistake, so I apologize in for the cross-posting.)
I have several forms that get completed, then sent using the mail function in PHP as Excel documents. I use the following code to do so:
mail($recipient, $subject, $content, "From: $email\r\nReply-To: $email\r\nX-Mailer: JJ_formmail\ncontent-type: application/vnd.ms-excel\nContent-Disposition: filename=membership.xls");
Most times this works fine, but other times it sends garbled information in the body of the email, with no attachment. Is there a better, more consistent way to do this? Also, when sending the email in this way, the email body is blank (since the body is being sent as the attachment). Is there any way to have both the attachment and text within the body of the email?
After reading some things, it seems that different versions of IE might have header problems. Is it know what versions of IE would work with the above code? Is there another way to do it, such as sending it as a csv file, that would be more universal? (If so, what would the code for that be?)
Thanks very much for any and all suggestions and ideas!