Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
SmtpAuthenticationFailedException
soulcrys
December 2014
Hello, Im trying to write a Contact page, but my code has a problem, but I dk where.
This error is Email\SmtpAuthenticationFailedException [ Error ]: Failed authentication.
PKGPATH/email/classes/email/driver/smtp.php @ line 219
Here's my code:
<?php
class Controller_Contact extends Controller_Template {
public function action_index() {
$form = Fieldset::forge();
$textarea = array('type' => 'textarea', 'cols' => 40, 'rows' => 5);
$submit = array('type' => 'submit', 'value' => 'Send');
$form->add('to', 'To')
->add_rule('valid_email')
->add_rule('required');
$form->add('from', 'From')
->add_rule('valid_email')
->add_rule('required');
$form->add('subject', 'Subject');
$form->add('body', 'Body', $textarea)
->add_rule('required');
$form->add('submit', '', $submit);
$form->repopulate();
$view = View::forge('contact/test1');
$view->set_safe('mail_form', $form);
$val = $form->validation();
if ($val->run()) {
$to = Input::post('to');
$from = Input::post('from');
$subject = Input::post('subject');
$body = Input::post('body');
$email = Email::forge();
$email->to($to);
$email->from($from);
$email->subject($subject);
$email->body($body);
$email->send();
return Response::forge(View::forge('contact/test2'));
} else {
$errors = $val->error();
$view->set('errors', $errors);
return $view;
}
}
}
Email config file:
'driver' => 'smtp',
'smtp' => array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => 'xxx@gmail.com',
'password' => 'xxx',
'timeout' => 5,
'starttls' => false,
Someone could give me some advices
Harro
December 2014
Did you set the newline to "\r\n" ?
soulcrys
December 2014
Yes, I did.
soulcrys
December 2014
Sorry, I fixed it, the problem is my gmail account, I already turn on POP3 and IMAP but my account didnt active them, but now is ok.
Sorry to bother you.
Harro
December 2014
No problem, good you've fixed it.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
December 2014
soulcrys
December 2014