Ivan - Add FakeSMTP support [skip ci]

This commit is contained in:
ivan 2016-07-14 19:53:24 -03:00
parent e6fb52791e
commit 9a25e7b7ae
2 changed files with 23 additions and 5 deletions

View File

@ -77,4 +77,22 @@ Just as there is the `gulp dev` task for development, there is also a `gulp prod
3. Install bundle `sudo gem install bundler`
4. Go to test folder `cd os4-react/tests`
5. Install project dependencies `sudo gem install bundler`
Test can run by using executing `run-tests.sh` file.
Test can run by using executing `run-tests.sh` file.
##### BACKEND SMTP SERVER TESTING
An email SMTP server can be configured in by EmailSender class. If you're doing development, you can use a fakeSMTP server.
1. Install java if you don't have it
`sudo apt-get install default-jre`
`sudo apt-get install default-jdk`
2. Download FakeSMTP: https://nilhcem.github.io/FakeSMTP/download.html
3. Extract the file from the zip and run it
`java -jar fakeSMTP-2.0.jar`
4. Set the port to 7070 and start the SMTP server
5. Now every time that the application sends an email, it will be reflected there.

View File

@ -5,11 +5,11 @@ class MailSender {
//TODO: Add real initial options when Settings class is available
public function __construct() {
$this->mailOptions['from'] = '';
$this->mailOptions['from'] = 'noreply@opensupports.com';
//SMTP Options
$this->mailOptions['smtp_host'] = '';
$this->mailOptions['smtp_port'] = 0;
$this->mailOptions['smtp_host'] = 'localhost';
$this->mailOptions['smtp_port'] = 7070;
$this->mailOptions['smtp_user'] = '';
$this->mailOptions['smtp_pass'] = '';
}
@ -36,7 +36,7 @@ class MailSender {
$mailer->Port = $this->mailOptions['smtp_port'];
$mailer->Username = $this->mailOptions['smtp_user'];
$mailer->Password = $this->mailOptions['smtp_pass'];
$mailer->SMTPSecure = "tls";
//$mailer->SMTPSecure = "tls";
$mailer->Timeout = 1000;
if ($mailer->smtpConnect()) {