0
votes

Mail is being send with file attachemant but its not possible to open it.

what is the problem please solve out this.

--PHP-mixed- Content-Type: multipart/alternative; boundary="PHP-alt-" --PHP-alt- Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello World!!! This is simple text email message. --PHP-alt- Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit

Hello World!

This is something with HTML formatting.

--PHP-mixed- Content-Type: $file_type; name=$file_name Content-Transfer-Encoding: base64 Content-Disposition: attachment --PHP-mixed---
2
I suggest that you use PHPmailer phpmailer.worxware.comAL-Kateb
I can highly recommend the Mail module of the zeta components for sending mails with attachements. Will make your life a whole lot easier.Till Helge
@AL-Kateb what u mean to say? And where i use PHPmailer phpmailer.worxware.com?please delete me
I am using this code and mail is being send but file is not opening.please delete me

2 Answers

2
votes

You don't build your own MIME emails. Use PHPMailer or Swiftmailer, which do almost everything for you. You can replace you entire script with about 5 or 6 lines of code.

And best of all, they'll give you far better error messages/diagnostics than the pathetically stupid mail() function ever will.

Also The Geekmail PHP library makes it easy to add attachments to emails

0
votes

what is "mysql_error"? i think the correct syntax for you die statement is

die(mysql_error());

or

die($mysql_error);