Re: Embed images to HTML-mails

2008-07-15 Thread Lance Willett

 But it just gives me an img src='... but not the actual image.

That HTML image element is a reference to the image; browsers and HTML-
enabled email readers will display it correctly. When you say not the
actual image, do you mean:

(1) the image doesn't display correctlty in the email you sent?
(2) the HTML code itself shows up in the email display instead of the
image?

For (1): Check that the image path is correct ('logo.gif' should be in
your /app/webroot/img/ directory). Also, some email programs don't
show images by default, so it might look broken.

For (2): Ensure that the email program you are using to read the sent
email supports images and HTML formatting. If you are trying to read
an HTML email in plain text, you will undoubtedly see some HTML code.

If you want to send the email with both plain text (no images) and
HTML (images, layout, etc), take a look at the built-in Email
component in CakePHP: http://book.cakephp.org/view/176/email.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP 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
-~--~~~~--~~--~--~---



Re: Embed images to HTML-mails

2008-07-15 Thread Jonathan Snook

On Tue, Jul 15, 2008 at 6:04 AM, Meloy [EMAIL PROTECTED] wrote:
 But how do I add an image to the HTML-part?

 I tried to do something like this in the layout:
 ?php e($html-image('logo.gif')); ?
 But it just gives me an img src='... but not the actual image.

 What am I doing wrong?

You're not doing anything *wrong*, per se, but the CakePHP Email
component wasn't really designed to do this. You may be able to pull
it off by attaching the image and referencing the ID of that image in
your HTML part but I forget how to do that (it's not really covered
these days and, from what I hear, is flagged as spam more often than
not.)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP 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
-~--~~~~--~~--~--~---



Re: Embed images to HTML-mails

2008-07-15 Thread Lance Willett

 but the CakePHP Email component wasn't really designed to do this.

@Jonathan Snook
Sending images in HTML email with the Email component works just fine;
you don't need to send it as an attachment. And yes, if you have a
very large amount of images, it might get marked as spam by the
recipient email client (but that's a differerent topic for a different
day).

@Meloy
Make sure that the image path is not relative, but instead pointing to
a live production image.

Example of the image reference in the email view file:
 ?php e($html-image('http://live-site.com/logo.gif')); ?

Note the http://live-site.com/; addition so that CakePHP doesn't use
the relative path.

I tested this just now with with CakePHP 1.2.x.x revision 7333 and it
works as expected in HTML-aware email clients (Gmail, Mail,
Thunderbird).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP 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
-~--~~~~--~~--~--~---



Re: Embed images to HTML-mails

2008-07-15 Thread Jonathan Snook

On Tue, Jul 15, 2008 at 2:25 PM, Lance Willett [EMAIL PROTECTED] wrote:

 but the CakePHP Email component wasn't really designed to do this.

 @Jonathan Snook
 Sending images in HTML email with the Email component works just fine;
 you don't need to send it as an attachment. And yes, if you have a
 very large amount of images, it might get marked as spam by the
 recipient email client (but that's a differerent topic for a different
 day).

Let me clarify since I think you missed what I was trying to say. Yes,
you can link to images hosted on the interwebs just fine and the
CakePHP component will work just fine to accomplish this. What the
person is asking to do, however, is have the image encoded within the
email as part of a multi-part email. This is different than what you
are suggesting.

Anyways, after trying to track down more info on this for the original
poster, look into Swift. Here's an example of doing an embedded image:
http://swiftmailer.org/wikidocs/v3/tutorials/embedding_images

-Jonathan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP 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
-~--~~~~--~~--~--~---



Re: Embed images to HTML-mails

2008-07-15 Thread Lance Willett

 Let me clarify since I think you missed what I was trying to say.
 This is different than what you are suggesting.

Sorry for hijacking the thread—I did indeed misunderstand Meloy's
question. And yes, you are right in saying that the Email component is
not designed to embed images in emails.

 Anyways, after trying to track down more info on this for the original
 poster, look into Swift. Here's an example of doing an embedded 
 image:http://swiftmailer.org/wikidocs/v3/tutorials/embedding_images

There is a 1.1.x.x Bakery article on SwiftMailer Component
Tutorial (http://bakery.cakephp.org/articles/view/swiftmailer-
component-tutorial), but I'm not sure if that would or work well with
a 1.2.x.x app. At the bottom of the tutorial, there is a section
called Bonus where the author explains how to embed an image using
Swift.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP 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
-~--~~~~--~~--~--~---



Re: Embed images to HTML-mails

2008-07-15 Thread Renan Gonçalves
If you want put the full url, you can do this:
?= FULL_BASE_URL . $html-image()) ?

I think its more simple and less weight than embed image on a email.


[]'s

On Tue, Jul 15, 2008 at 5:34 PM, Lance Willett [EMAIL PROTECTED] wrote:


  Let me clarify since I think you missed what I was trying to say.
  This is different than what you are suggesting.

 Sorry for hijacking the thread—I did indeed misunderstand Meloy's
 question. And yes, you are right in saying that the Email component is
 not designed to embed images in emails.

  Anyways, after trying to track down more info on this for the original
  poster, look into Swift. Here's an example of doing an embedded image:
 http://swiftmailer.org/wikidocs/v3/tutorials/embedding_images

 There is a 1.1.x.x Bakery article on SwiftMailer Component
 Tutorial (http://bakery.cakephp.org/articles/view/swiftmailer-
 component-tutorialhttp://bakery.cakephp.org/articles/view/swiftmailer-component-tutorial),
 but I'm not sure if that would or work well with
 a 1.2.x.x app. At the bottom of the tutorial, there is a section
 called Bonus where the author explains how to embed an image using
 Swift.


 



-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP 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
-~--~~~~--~~--~--~---