-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
68 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
abstract class Kohana_Mailer_Transport { | ||
public function build ( $config ) {} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class Kohana_Mailer_Transport_Native extends Kohana_Mailer_Transport { | ||
|
||
public function build ( $config ) { | ||
return Swift_MailTransport::newInstance(); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class Kohana_Mailer_Transport_Sendmail extends Kohana_Mailer_Transport { | ||
|
||
public function build ( $config ) { | ||
return Swift_SendmailTransport::newInstance(empty($config['options']) ? "/usr/sbin/sendmail -bs" : $config['options']); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class Kohana_Mailer_Transport_SMTP extends Kohana_Mailer_Transport { | ||
|
||
public function build ( $config ) { | ||
//Create the Transport | ||
$transport = Swift_SmtpTransport::newInstance() | ||
->setHost(empty($config['hostname']) ? "localhost" : (string) $config['hostname']) | ||
->setUsername(empty($config['username']) ? NULL : (string) $config['username']) | ||
->setPassword(empty($config['password']) ? NULL : (string) $config['password']); | ||
|
||
//Port? | ||
$port = empty($config['port']) ? 25 : (int) $config['port']; | ||
$transport->setPort($port); | ||
|
||
//Use encryption? | ||
if (! empty($config['encryption'])) | ||
{ | ||
$transport->setEncryption($config['encryption']); | ||
} | ||
|
||
return $transport; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class Mailer_Transport_Native extends Kohana_Mailer_Transport_Native {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class Mailer_Transport_Sendmail extends Kohana_Mailer_Transport_Sendmail {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class Mailer_Transport_SMTP extends Kohana_Mailer_Transport_SMTP {} |