Questions tagged [cakeemail]

CakeEmail is a CakePHP class to send email. With this class one can send email from any place in your application. In addition to using the EmailComponent from your controller, you can also send mail from Shells and Models.

Official Document

Basic Usage:

$Email = new CakeEmail();
$Email->from(array('me@example.com' => 'My Site'))
    ->to('you@example.com')
    ->subject('About')
    ->send('My message');
30 questions
0
votes
2 answers

Accessing the CakeEmail subject from a template/layout

I'm using CakeEmail as follows: $Email = new CakeEmail(); $Email->template('my_template', 'my_layout'); $Email->subject('My Subject'); // ... How do I access the 'My Subject' value in my_layout.ctp? The closest thing I could find was this but it's…
ᴍᴇʜᴏᴠ
  • 4,804
  • 4
  • 44
  • 57
0
votes
1 answer

How do I call a function before every email send?

I have about 50 different email templates whose text changes dynamically based on who the recipient is. Rather than make a different template for every possible case and include similar logic across dozens of different controller files, I want to…
Marlon Dyck
  • 575
  • 2
  • 6
  • 13
0
votes
1 answer

Icalendar .ics not showing issue after adding html content

I got this issue with icalendar, it doesn't show the attachment and the confirmation button when sent to gmail,yahoo, aoutlook.com. it was working before without html message and multipart/mixed header. now when i recieve the email it only show me…
Monologie
  • 11
  • 3
0
votes
0 answers

CakeEmail Attachement Files

I'm using CakePHP to develop my application. Now I'm trying to send Email with attachment file 'ics' but i got an error 'File not found ...' Here's what i've done untill now : $Email = new…
B.O
  • 11
  • 4
0
votes
1 answer

How to pass 2 variables in viewVars

$message[0] = $unique_password[0]['users']['firstname']; $message[1]='Please click on this link to reset your password: http://test.com/reset_password?password='.$unique_password; $Email = new CakeEmail(); …
0
votes
1 answer

CakeEmail not working

This my code in cakephp method in one of my controller , but no email is coming to account. I really need help on this. When I printing $cc variable , its giving an output of array , but dont know how to know whether mail has been send…
0
votes
0 answers

CakePHP CakeEmail Could not send email

I have looked through almost all existing threads, but I still can't find the problem, so I decided post a new one. I have code that is running on my live server and the email function is working perfectly fine. It was setup by a contractor and he…
nigong
  • 1,727
  • 3
  • 19
  • 33
0
votes
1 answer

CakePHP 2 testing model with no table using mock method for email

I'm attempting to write a test for a model that has no table but sends an email if the data passes validation in CakePHP 2. To test I want to assert that some data passes validation and would therefore send an email without actually sending one.…
drmonkeyninja
  • 8,490
  • 4
  • 31
  • 59
0
votes
1 answer

Why wont my CakeEmail send?

I have the following function being called from my view.ctp file after a form button is pressed. However nothing is being recieved. Any advice? public function email(){ // ============Email================// /* SMTP Options…
heatl0rd
  • 1
  • 2
0
votes
0 answers

Email is not going to deliever on yahoo server

I am using cakephp, and sending email through cakeemail with smtp. My hosting is on 1and1.com. Email is going to deliver on gmail but not on yahoo and hotmail. Then I try the PHPMailer on same server and its email was going to deliver on gmail and…
nbhatti2001
  • 353
  • 2
  • 7
  • 33
0
votes
2 answers

Trying to dump Object or Array in CakePHP

I am trying to dump an object or an array into the debug while coding on CakePHP. I have been trying a variety of commands, and I've honestly lost track of the various outputs. I've definitely seen an output indicating the object type (CakeEmail)…
Islam Tawfik
  • 17
  • 1
  • 6
0
votes
1 answer

Check for a 'Connection timed out'

There's some trick i can do to check if the $cake_email->send() get Connection timed out ?For example: if I get a Connection Timed Out, i use a especific setFlash warning the user about the time out and redirect him to somewhere. In my case, the…
Matheus Vellone
  • 79
  • 1
  • 2
  • 8
0
votes
1 answer

Sending email works on test but not on production system

In my model I'm sending an email once the User is created: Model/User.php:
mosquito87
  • 4,270
  • 11
  • 46
  • 77
0
votes
0 answers

Email sent through CakeEmail showing attachments icon in outlook even when no attachments is sent

I have using CakeEmail to send email but when I send Html and text email then the email show the attachment icon in the outlook . I found that it is because of header Content-type: multipart/mixed; . But it should be…
0
votes
3 answers

Cakephp - How to loop through array in email template?

I am able to set the viewVars for a single record and mail it successfully. A problem occurs when I want to send an email containing more than one record. I find the correct records and I am able to pass them to my mail function. The problem comes…
Cody
  • 112
  • 9
1
2