Skip to content

Commit 7ba632d

Browse files
author
Richard Roque
committed
Firs Commit
0 parents  commit 7ba632d

File tree

169 files changed

+20095
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+20095
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
config.php

config.sample.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
return array(
3+
'host'=>'smtp.gmail.com',
4+
'port'=>'465',
5+
'username'=>'example@gmail.com',
6+
'password'=>'example'
7+
);

index.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
error_reporting(E_ALL^E_NOTICE);
3+
4+
$config = require_once('config.php');
5+
$data = $_POST['Message'];
6+
7+
if($_POST && $_POST['Mwessage']) {
8+
$data = $_POST['Message'];
9+
require_once 'vendors/swift/lib/swift_required.php';
10+
$transport = Swift_SmtpTransport::newInstance($config['host'], $config['port'], "ssl");
11+
$transport->setUsername($config['username']);
12+
$transport->setPassword($config['password']);
13+
$mailer = Swift_Mailer::newInstance($transport);
14+
$message = Swift_Message::newInstance($data['subject']);
15+
$message->setFrom(array($data['from'] => $data['from']));
16+
$message->setTo(array($data['to']));
17+
$message->setBody($data['body']);
18+
$result = $mailer->send($message);
19+
}
20+
?>
21+
<!DOCTYPE HTML>
22+
<html lang="en-US">
23+
<head>
24+
<meta charset="UTF-8">
25+
<title></title>
26+
</head>
27+
<body>
28+
<?=$result?>
29+
<form action="" method="post">
30+
<table>
31+
<tr>
32+
<td>From: </td>
33+
<td><input type="email" name="Message[from]" value="<?=$data['from']?>"/></td>
34+
</tr>
35+
<tr>
36+
<td>To: </td>
37+
<td><input type="email" name="Message[to]" value="<?=$data['to']?>"/></td>
38+
</tr>
39+
<tr>
40+
<td>Subject: </td>
41+
<td><input type="text" name="Message[subject]" value="<?=$data['subject']?>"/></td>
42+
</tr>
43+
<tr>
44+
<td>Body</td>
45+
<td><textarea name="Message[body]" id="" cols="30" rows="10"> <?=$data['body']?></textarea></td>
46+
</tr>
47+
<tr>
48+
<td></td>
49+
<td><input type="submit" value="Send"/></td>
50+
</tr>
51+
</table>
52+
</form>
53+
</body>
54+
</html>

vendors/swift/lib/classes/Swift.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
/*
4+
* This file is part of SwiftMailer.
5+
* (c) 2004-2009 Chris Corbyn
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
/**
12+
* General utility class in Swift Mailer, not to be instantiated.
13+
*
14+
* @package Swift
15+
*
16+
* @author Chris Corbyn
17+
*/
18+
abstract class Swift
19+
{
20+
public static $initialized = false;
21+
public static $inits = array();
22+
23+
/** Swift Mailer Version number generated during dist release process */
24+
const VERSION = '5.0.1';
25+
26+
/**
27+
* Registers an initializer callable that will be called the first time
28+
* a SwiftMailer class is autoloaded.
29+
*
30+
* This enables you to tweak the default configuration in a lazy way.
31+
*
32+
* @param mixed $callable A valid PHP callable that will be called when autoloading the first Swift class
33+
*/
34+
public static function init($callable)
35+
{
36+
self::$inits[] = $callable;
37+
}
38+
39+
/**
40+
* Internal autoloader for spl_autoload_register().
41+
*
42+
* @param string $class
43+
*/
44+
public static function autoload($class)
45+
{
46+
//Don't interfere with other autoloaders
47+
if (0 !== strpos($class, 'Swift_')) {
48+
return;
49+
}
50+
51+
$path = dirname(__FILE__).'/'.str_replace('_', '/', $class).'.php';
52+
53+
if (!file_exists($path)) {
54+
return;
55+
}
56+
57+
require $path;
58+
59+
if (self::$inits && !self::$initialized) {
60+
self::$initialized = true;
61+
foreach (self::$inits as $init) {
62+
call_user_func($init);
63+
}
64+
}
65+
}
66+
67+
/**
68+
* Configure autoloading using Swift Mailer.
69+
*
70+
* This is designed to play nicely with other autoloaders.
71+
*
72+
* @param mixed $callable A valid PHP callable that will be called when autoloading the first Swift class
73+
*/
74+
public static function registerAutoload($callable = null)
75+
{
76+
if (null !== $callable) {
77+
self::$inits[] = $callable;
78+
}
79+
spl_autoload_register(array('Swift', 'autoload'));
80+
}
81+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
/*
4+
* This file is part of SwiftMailer.
5+
* (c) 2004-2009 Chris Corbyn
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
/**
12+
* Attachment class for attaching files to a {@link Swift_Mime_Message}.
13+
*
14+
* @package Swift
15+
* @subpackage Mime
16+
* @author Chris Corbyn
17+
*/
18+
class Swift_Attachment extends Swift_Mime_Attachment
19+
{
20+
/**
21+
* Create a new Attachment.
22+
*
23+
* Details may be optionally provided to the constructor.
24+
*
25+
* @param string|Swift_OutputByteStream $data
26+
* @param string $filename
27+
* @param string $contentType
28+
*/
29+
public function __construct($data = null, $filename = null, $contentType = null)
30+
{
31+
call_user_func_array(
32+
array($this, 'Swift_Mime_Attachment::__construct'),
33+
Swift_DependencyContainer::getInstance()
34+
->createDependenciesFor('mime.attachment')
35+
);
36+
37+
$this->setBody($data);
38+
$this->setFilename($filename);
39+
if ($contentType) {
40+
$this->setContentType($contentType);
41+
}
42+
}
43+
44+
/**
45+
* Create a new Attachment.
46+
*
47+
* @param string|Swift_OutputByteStream $data
48+
* @param string $filename
49+
* @param string $contentType
50+
*
51+
* @return Swift_Mime_Attachment
52+
*/
53+
public static function newInstance($data = null, $filename = null, $contentType = null)
54+
{
55+
return new self($data, $filename, $contentType);
56+
}
57+
58+
/**
59+
* Create a new Attachment from a filesystem path.
60+
*
61+
* @param string $path
62+
* @param string $contentType optional
63+
*
64+
* @return Swift_Mime_Attachment
65+
*/
66+
public static function fromPath($path, $contentType = null)
67+
{
68+
return self::newInstance()->setFile(
69+
new Swift_ByteStream_FileByteStream($path),
70+
$contentType
71+
);
72+
}
73+
}

0 commit comments

Comments
 (0)