Well guys, I had to tweak it..But since yesterday, form the branch it seems better ...I can send mails with attachments with the original component... However there is one case a bit ennoying (not really a problem), but if you send a mail as html without attachment..it display a warning about my mail reader (Thunderbird) ..So maybe Thunderbird is not the best after all..
I have removed all my patches, concerning this component ... and I am quite happy.. On Oct 19, 3:15 pm, luke BAKING barker <[EMAIL PROTECTED]> wrote: > hmm looking more closely at mine, I actually get a weird error. > > My layout is rendering, asHTML in the email, but the view is not. > However - in the original (show original as I am looking at in GMail) > the view HTML does show. I havent included anything weird, but I > wonder if there is some missing encoding going on on the view part. I > am looking at the email.php lines to see if I can fix this: > > function send($content = null, $template = null, $layout = null) { > $this->__createHeader(); > $this->subject = $this->__encode($this->subject); > > if ($template) { > $this->template = $template; > } > > if ($layout) { > $this->layout = $layout; > } > > if (($template === null) && ($this->template === null)) { > if (is_array($content)) { > $message = null; > foreach ($content as $key => $value) { > $message .= $value . $this->_newLine; > } > } else { > $message = $content; > } > $this->__formatMessage($message); > } else { > $this->__message = $this->__renderTemplate($content); > } > > if (!empty($this->attachments)) { > $this->__attachFiles(); > } > > if (!is_null($this->__boundary)) { > $this->__message .= $this->_newLine .'--' . > $this->__boundary . > '--' . $this->_newLine . $this->_newLine; > } > > somewhere in there lies why! > > Luke > > On Oct 19, 1:03 pm, luke BAKING barker <[EMAIL PROTECTED]> wrote: > > > Hi Francky, > > > I just had a similar bit of difficulty getting this going. > > > I don't think it is a bug though, there were a coupe of things: > > > 1) I had an absoulte filepath for my $attachment; but you must specify > > a filepath (look at theemail.php code to see -- if there are no > > filepaths it won't work, sO I just chanegd to relative path and > > included the lines like so : > > > $this->Email->attachments[] = $poem['Poem']['filename']; > > $this->Email->filePaths[] = WWW_ROOT . $this->Poem->uploads ;// > > require this relative path prefix > > > 2) My install of PHP on my hosting didnt have mime_content_type (it is > > deprecated and also I think needs magic.mime enabled in php.ini > > > so in my app/config/bootstrap I whacked this: > > if (!function_exists('mime_content_type')) { > > function mime_content_type($file) { > > > return trim ( exec ('file -bi ' . escapeshellarg ( $file ) > > ) ) ; > > > } > > > } > > > I might adjust this in fact as I don't like using exec, it was jsut to > > get it working. (opinons on this function please!) > > > 3) it still didnt work but I was getting the attahcment inline; > > garbled. > > > I noticed there was no newline though, and so in myemail/html/ > > default.ctp email/text/default.ctp layouts > > I added a newline at the end... > > > And SUCCESS! thanks for theEmailcomponentdevs :) makes it very > > easy... > > > hth > > > Luke aka boobyWomack > > > On Oct 2, 11:17 pm, francky06l <[EMAIL PROTECTED]> wrote: > > > > Does anyone succeed to send a 'text' message with an attached file > > > using theEmailcomponent? > > > > I am using the cake1.2 from branch, and when attaching a file to a > > > simple text mail, the "content" does not appear, the attachment is > > > there. > > > If I remove the attachment, the content is there. Same results using > > > "html", also after trying to send a template. > > > I use UTF-8 charset, very simple default layout (text is just <?php > > > echo $content_for_layout; ?> ). > > > > I am using Thunderbird, and looking at the message source, actually > > > the content is there but not showing. > > > Seems to be a story of boundary / new lines, but mail protocol is not > > > my cup of tea. > > > > Anyone experienced this and maybe give me some hints ? > > > > Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---