Created
December 10, 2013 22:07
-
-
Save gkilmain/7901131 to your computer and use it in GitHub Desktop.
index.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Email One Off</title> | |
<style type="text/css"></style> | |
</head> | |
<body> | |
<form action="process.php" method="POST"> | |
<p>To</p> | |
<input type="text" name="to" id="to" /> | |
<p>From</p> | |
<input type="text" name="from" id="from" /> | |
<p>Subject</p> | |
<input type="text" name="subject" id="subject" /> | |
<p>Paste your HTML below</p> | |
<textarea cols="100" rows="40" name="bodycontent"></textarea> | |
<input type="submit" value="Submit" /> | |
</form> | |
</body> | |
</html> |
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
<?php | |
require_once 'lib/swift_required.php'; | |
$to = $_POST['to']; | |
$from = $_POST['from']; | |
$subject = $_['subject']; | |
$bodycontent = htmlspecialchars($_POST['bodycontent']); | |
// create transport | |
//$bodycontent = '<html><head><title>title</title></head><body><table><tr><td><img src="http://www.kilmain.com/suitandtie.jpg" width="480" height="640" /></td></tr></table></body></html>'; | |
$transport = Swift_SmtpTransport::newInstance('relay-hosting.secureserver.net', 25) | |
//->setUsername('[email protected]') | |
//->setPassword('hocskey$1') | |
; | |
$mailer = Swift_Mailer::newInstance($transport); | |
$message = Swift_Message::newInstance(); | |
$message->setSubject($subject); | |
$message->setFrom($from); | |
$message->setTo($to); | |
$message->setBody($bodycontent, 'text/html'); | |
$mailer->send($message); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment