Email smtp authentication

edited February 2011 in Feature Requests
Is there a fuel method in place to take advantage of the CI Email library (fuel/codeigniter/libraries/Email.php) to send mail using the smtp username and password? I've been sifting through the files but haven't found anything. If not, this would be a good thing to add since most servers now require authentication to send mail using php.

Comments

  • edited 4:14AM
    You should be able to load it up like any other CI library (e.g. $this->load->library('email');. You could also add an fuel/application/config/email.php like other CI library classes to provide initialization parameters.
  • edited 4:14AM
    Ok. Thanks.
  • edited 4:14AM
    I'm having to use a different smtp server and it requires authentication. I found fuel/application/config/email.php and added these lines:
    $config['wordwrap'] = TRUE; $config['protocol'] = "smtp"; $config['smtp_host'] = "mail.theremoteserver.net"; $config['smtp_user'] = "user@theremoteserver.net"; $config['smtp_pass'] = "theP@ssw0rd"; $config['smtp_port'] = "26"; $config['smtp_auth'] = true;
    In the contact.php controller I'm loading what I assume to be the CI email library like:
    $this->load->library('email');
    Then, borrowed a good bit of your script for validating and such and of course towards the end of the script I have:
    $this->email->send()
    Is that all that's needed to assure the email will send using the remote smtp server?
  • edited 4:14AM
    I believe so.
Sign In or Register to comment.