send mail attach

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
adv
Forum Newbie
Posts: 1
Joined: Wed Nov 30, 2011 7:47 am

send mail attach

Post by adv »

hello this is my first post here :D

Code: Select all

//*** Files 1 ***//   
$strFilesName1 = "attach.html";  
$contents = file_get_contents($strFilesName1);  
#$strContent1 = chunk_split(base64_encode($contents));   



$strContent1 = chunk_split(base64_encode($contents));   
$strHeader .= "--".$strSid."\n";   
$strHeader .= "Content-Type: application/octet-stream; name=\"".$strFilesName1."\"\n";   
$strHeader .= "Content-Transfer-Encoding: base64\n";   
$strHeader .= "Content-Disposition: attachment; filename=\"".$strFilesName1."\"\n\n";   
$strHeader .= $strContent1."\n\n";
i`m trying just to attach the file simple no distrubing the original content


and i get this

Code: Select all

²Ü¥zÜ©xÆßܲË]~‰í}©¢— +‰©Gz[Þ¶'±©ì±êâ}ú'¶È³{]©ÅÊ%¢¾ºëû-ÊW­i¹^Â'm„Ú¢‚ß?Û¢·^¬zYii×bžqée²–œŠxÒÚíw?¶ò) ²·†Ûiÿû¬jø¬iÊ&þ) þZ ¢ø¬jŸÂ'm„…è †ßû]µÜ"vØ×?"š+p¶ŸÿÃ&zÖ¢®'›jy¢o♨³û™«-z·­ÛrêÞr‡^¦x0‰Ûa×M!z(!´þ×mw?¶ãyÛ²Ÿíwûk¶»]r‰l¥©Þ‘žžØ¥y©šn)^–ç"£vëþšCº¶§µéZž‹-­¨²Ø¨?ç(žÚ+z %j¹žž×©®ˆ+jišµ§©®‡vêÚv+Þ®'âq¦›n&¦¢¸¥zö­¢éé‰Ç(–‡«®ŠÞ?émº†œr‹§µž²Ú)¢ÚÞm·ž²Ç«yÚ/ºÚŠÇ ¹éíŠj-Šø›¯U'­çž×œjfâjg§¶‰Þ–W¯¢Ëkz)ߢ¹šÎ*'Š—«²‰Ú–'¬q©›Š‡bŠwb®,ó¢)ÝŠ¸³Î‡¦j)[¯bâ?Æ©iÈ­j Ú½çb½êâ~'­æœrêÚµ©žž×¬zW³Š‰Úµ©h§8¨?çb¥¨™éí¡§ºÆ?ŠéÞ®º+z)íz¹èjYbž×«ž‡^Šz,¶¸¬ŠË^š n&¦¡«miǶ‹§iú+™¦ª¹ë-i隊VëJ*kz?ŠÇ®'­è¥š‡n–‡¬z¢­é^ŠËk»8¨ž+.–Z,r«š†ëþšM90–jºZz÷ž²Ç«yª^®Ú"žéÛ®Œ,z¹¨uêç¡È^…¢Z½«®*mi¸¥ŠÖ­¡ëž×«?ëDÆ™h­êÅŠ·Ÿ£^¶Ç¥æëV*kzbjj‰Ê&¦·§uêÞrª¹ë-iè+j÷®?©¢²êÚv+"rêÞÏ6?zËb?«Z¥êÜ¢{k‰»¢­æ©®‹^‚«zú"yØ¥¾‹-®‡(žÚŠÇ.²&¦¢—«‚Xž½éí¹©bv+‚$ž±Ç –'­yØ¢‚z+j·¥jz,¶¶«‰ÈbzËZr)Z±Èšj[kjÇ–Öœ…ë(²—§uê޵驢¶§y©žž×¢–Û¨iÇ(º{Uz¸Ÿ‰ç[ÉX¬iÊ'¶†ëþšF­¬â{úiV+"Ö¥‰¤¢rêÞÏ6’ªæ?­¯éþ×¶»kµ×(–ÊZœnʵßí¯ûZnW
what could the problem be ?
and please can someone tell me the most common problems when i get this error.
thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: send mail attach

Post by Christopher »

The data is base64 encoded. The email client should decode it when received.
(#10850)
Post Reply