AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() = "Content-Disposition: attachment".$eol = "Content-Transfer-Encoding: base64".$eol ![]() = "Content-Type: application/octet-stream name=\"".$filename."\"".$eol = "Content-Transfer-Encoding: 8bit".$eol.$eol = "Content-Type: multipart/mixed boundary=\"".$separator."\"".$eol // see below The attachment doesn't go in the headers! They should only declare the MIME headers: // main header (multipart mandatory) = "Content-Disposition: attachment".$eol.$eol = "This is a MIME encoded message.".$eol.$eol = "Content-Transfer-Encoding: 7bit".$eol = "Content-Type: multipart/mixed boundary=\"".$separator."\"".$eol.$eol $attachment = chunk_split(base64_encode($pdfdoc)) encode data (puts attachment in proper format) carriage return type (we use a PHP end of line constant) a random hash will be necessary to send mixed content $from = "send email with pdf attachment" $pdf->Cell(40,10, "this is a pdf example") Warning: mail() : SMTP server response: 503 Unexpected command or sequence of commands in C:\AppServ\www\PhpProject1\CV-Generator\testemail2.php on line 55 I can send a text email perfectly but with an attachment I get the following error: I'm trying to send an email using the mail() function in php with a pdf attachment.
0 Comments
Read More
Leave a Reply. |