I've been having a little bit of a problem with my app when using the
Email component.
I have a simple "Contact" form with around 8-10 fields. When the user
submits the form, the data is stored in the database as well as
sending out an email to the admin that a submission has been made.
For some reason, the submission of the form takes about 10-15 seconds
to be processed. If I remove the $this->Email->send(); is it basically
instantaneous. Any ideas? I'll past my controller logic below.
function add() {
$show_form = true;
if (!empty($this->data)) {
$this->ClientInquery->create();
if ($this->ClientInquery->save($this->data)) {
$this->Session->setFlash('Your inquery has been
sent! Someone from
our studio should contact you within 1-2 business days.',
'flash_message');
$show_form = false;
$this->set('ClientInquery', $this->data);
//send email to admin as reminder
$this->Email->reset();
$this->Email->to = '[email protected]';
$this->Email->subject = "Photography Inquery - " .
$this->data['ClientInquery']['name'];
$this->Email->template = "photography_inquery";
$this->Email->from = "[email protected]";
$this->Email->sendAs = 'html'; // because we like to
send pretty mail
$this->Email->send();
} else {
$this->Session->setFlash('Your inquery has not been
sent! Please fix errors.', 'flash_message');
}
}
$this->set('show_form', $show_form);
}
As I said. It's very basic and the problem goes away when I simply
remove the $this->Email->send().
Any ideas?
-Jesse
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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