Re: Email Component sends email with empty body

2008-05-20 Thread donnerbeil

Hi!

I couldn't get the delivery=debug working. But I now found out, that
if I set sendAs to 'html' or 'text' instead of 'both' the email is
received with a correct mail body. I finally found this ticket
https://trac.cakephp.org/ticket/1851 that describes something
similiar. But as I use a fresh nightly, that shouldn't be the case.

So the only solution for me is to send Emails in either html or text.

Maybe this thread and all the links help someone to solve similar
problems. If someone has the ultimate solution and can tell me, why
the delivery='debug' didn't work, that would be really great. I just
have to understand what's wrong.

Donnerbeil

--~--~-~--~~~---~--~~
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: Email Component sends email with empty body

2008-05-20 Thread Ketan Patel

Hi, for debug... it doesn't print now.. They changed the code for
debug, so now it is only put in the Session variable. So to print out
in the controller just for debugging to do this...

pr($this-Session-read('Message.email'));

Earlier in the code, they had the 'echo $fm' statement which is now
missing, don't know what was the reason to do so. But try the above
and it should work !!


--~--~-~--~~~---~--~~
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: Email Component sends email with empty body

2008-05-20 Thread Ketan Patel

There is a delivery option for debug in the EmailComponent.

$this-Email-delivery = 'debug'; //'smtp';

Use that for development and testing of the emails. With 'debug'
option, you will see your email content print out on the page itself
which helps in faster debugging. Once you are happy with output and
sorted out all issues, flip the delivery mode to whatever you wish.



On May 19, 9:54 pm, donnerbeil [EMAIL PROTECTED] wrote:
 Hi!

 I'm using the latest nightly so this is probably not the 
 case:https://trac.cakephp.org/ticket/3820

 But I still receive empty emails. The strangest part is, that it
 depends on the email provider. I have an email account at my own
 domain. I check the mails with Thunderbird (IMAP) and it works. Then I
 have an Email account at freenet.de, a popular email provider in
 germany. When I check the freenet account with thunderbird(Pop3) I get
 an empty email body. When I check the freenet account via the
 webinterface, I can read the body but it's not formatted correctly. It
 shows the headers then.

 I followed exactly the instructions 
 here:http://manual.cakephp.org/view/269/sending-a-basic-message

 I assume, that it has maybe something to do with utf8 encoding.
 Because when I check the freenet mail with Thunderbird and manually
 set the encoding for the mail  to utf8 in Thunderbird, then I can at
 least read the email, but still only with all the headers in it.

 I'm trying to fix this for over a week now. My whole web app is
 working, but I need to send an email with an activation code for the
 new users. So please help me fix this last issue.

 Thanks a lot for any help.

 Donnerbeil
--~--~-~--~~~---~--~~
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: Email Component sends email with empty body

2008-05-20 Thread donnerbeil

Hi!

Here is my send function in users_controller.php
The $id is given from another function. I debug($id) and it's ok.


function _sendNewUserMail($id) {
$User = $this-User-read(null,$id);
$this-Email-to = '[EMAIL PROTECTED]';
$this-Email-bcc = array('[EMAIL PROTECTED]');  // note
  // this could
be just a string too
$this-Email-subject = 'Welcome to our really cool thing';
$this-Email-replyTo = '[EMAIL PROTECTED]';
$this-Email-from = '[EMAIL PROTECTED]';
$this-Email-template = 'activate'; // note no '.ctp'
//Send as 'html', 'text' or 'both' (default is 'text')
$this-Email-sendAs = 'both'; // because we like to send pretty
mail
//Set view variables as normal
$this-set('User', $User);
//Do not pass any args to send()
$this-Email-send();
 }

The app\views\elements\email\html\activate.ctp

pDear ?php echo $User['User']['username'] ?,br /
 nbsp;nbsp;nbsp;Thank you for your interest./p

The app\views\elements\email\text\activate.ctp

Dear ?php echo $User['User']['username'] ?,
   Thank you for your interest.

The app\views\layouts\email\html\default.ctp
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
html
body
?php echo $content_for_layout; ?
/body
/html

The app\views\layouts\email\text\default.ctp

?php echo $content_for_layout; ?


So my layout is default.ctp and my element/template is activate.ctp.
Is that a problem? Or do I have to specifically set the layout
somewhere?

I also found this yesterday:http://marcgrabanski.com/tags.php?
tag=CakePHP

This could be a problem, since my users_controller.php is encoded in
utf8 because of some special chars in $this-Session-setFlash();

Setting $this-Email-charset = 'iso-8859-15'; didn't help

I'm confused

Donnerbeil

Also my DB is utf8 encoded. And my subject is also changed to
something like, =?UTF-8?B?V2VsY29tZ...

--~--~-~--~~~---~--~~
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: Email Component sends email with empty body

2008-05-20 Thread donnerbeil

@Ketan

My new send function looks now like that:

function _sendNewUserMail($id) {
$User = $this-User-read(null,$id);
$this-Email-to = '[EMAIL PROTECTED]';
$this-Email-bcc = array('[EMAIL PROTECTED]');  //
note
  // this
could
be just a string too
$this-Email-subject = 'Welcome to our really cool
thing';
$this-Email-replyTo = '[EMAIL PROTECTED]';
$this-Email-from = '[EMAIL PROTECTED]';
$this-Email-template = 'activate'; // note no '.ctp'
//Send as 'html', 'text' or 'both' (default is 'text')
$this-Email-sendAs = 'both'; // because we like to send
pretty
mail
//Set view variables as normal
$this-set('User', $User);
//Do not pass any args to send()
$this-Email-delivery='debug';
$this-Email-send();
 }


The emails aren't send any more, but I don't get any debug output. In
core.php, the debug level is set to 2.
What am I doing wrong? When I remove $this-Email-delivery='debug';
the emails are sent again. Where is the debug output. Also looked in
the html-sourcecode, to  check if it's hidden somewhere. nope, it's
just not there.

Donnerbeil

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Email Component sends email with empty body

2008-05-19 Thread donnerbeil

Hi!

I'm using the latest nightly so this is probably not the case:
https://trac.cakephp.org/ticket/3820

But I still receive empty emails. The strangest part is, that it
depends on the email provider. I have an email account at my own
domain. I check the mails with Thunderbird (IMAP) and it works. Then I
have an Email account at freenet.de, a popular email provider in
germany. When I check the freenet account with thunderbird(Pop3) I get
an empty email body. When I check the freenet account via the
webinterface, I can read the body but it's not formatted correctly. It
shows the headers then.

I followed exactly the instructions here: 
http://manual.cakephp.org/view/269/sending-a-basic-message

I assume, that it has maybe something to do with utf8 encoding.
Because when I check the freenet mail with Thunderbird and manually
set the encoding for the mail  to utf8 in Thunderbird, then I can at
least read the email, but still only with all the headers in it.

I'm trying to fix this for over a week now. My whole web app is
working, but I need to send an email with an activation code for the
new users. So please help me fix this last issue.

Thanks a lot for any help.

Donnerbeil

--~--~-~--~~~---~--~~
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: Email Component sends email with empty body

2008-05-19 Thread Brian Rojas

The most obvious problem would be that you aren't setting the Email-
template correctly.  This happened to me cause i misspelt the
template.  You should check that, also pls send code if that is not
problem so can investigate better.

On May 19, 8:54 pm, donnerbeil [EMAIL PROTECTED] wrote:
 Hi!

 I'm using the latest nightly so this is probably not the 
 case:https://trac.cakephp.org/ticket/3820

 But I still receive empty emails. The strangest part is, that it
 depends on the email provider. I have an email account at my own
 domain. I check the mails with Thunderbird (IMAP) and it works. Then I
 have an Email account at freenet.de, a popular email provider in
 germany. When I check the freenet account with thunderbird(Pop3) I get
 an empty email body. When I check the freenet account via the
 webinterface, I can read the body but it's not formatted correctly. It
 shows the headers then.

 I followed exactly the instructions 
 here:http://manual.cakephp.org/view/269/sending-a-basic-message

 I assume, that it has maybe something to do with utf8 encoding.
 Because when I check the freenet mail with Thunderbird and manually
 set the encoding for the mail  to utf8 in Thunderbird, then I can at
 least read the email, but still only with all the headers in it.

 I'm trying to fix this for over a week now. My whole web app is
 working, but I need to send an email with an activation code for the
 new users. So please help me fix this last issue.

 Thanks a lot for any help.

 Donnerbeil

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---