Created
October 11, 2013 15:01
-
-
Save ElmahdiMahmoud/6936215 to your computer and use it in GitHub Desktop.
php: email html template
This file contains hidden or 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
| <form method="post"> | |
| <input type="hidden" name="url" /> | |
| <ul> | |
| <li> | |
| <input class="w-90p" type="text" placeholder="Email" name="email" id="emailAddress" /> | |
| </li> | |
| <li> | |
| <textarea class="w-90p" name="message" placeholder="Write something..." id="messageText"></textarea> | |
| </li> | |
| <li> | |
| <button class="btn btn-primary pull-right" type="submit">Share</button> | |
| </li> | |
| </ul> | |
| </form> | |
| <!-- .form-with-placeholders --> | |
| <?php | |
| if(isset($_POST['email']) && isset($_POST['message'])) { | |
| $to = 'elmahdi.mahmoud@gmail.com'; | |
| $subject = 'Shared Link from ' . ' (' .$_POST['email']. ')'; | |
| $headers = "From: " . $_POST['email'] . "\r\n"; | |
| $headers .= "MIME-Version: 1.0\r\n"; | |
| $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; | |
| $message = '<html><body>'; | |
| /* Logo */ | |
| $message .= '<center><img src="http://www.thinklaunchgrow.com/greatplains/wp-content/uploads/2013/08/logo1.png" alt="GP" /></center>'; | |
| $message .= '<table width="100%" cellpadding="14">'; | |
| $message .= "<tr bgcolor='f7f7f7'><td><strong>From:</strong> </td><td>" . ($_POST['email']) . "</td></tr>"; | |
| $message .= "<tr><td><strong>Link:</strong> </td><td>" . ($_POST['url']) . "</td></tr>"; | |
| $message .= "<tr bgcolor='f7f7f7'><td><strong>Comment:</strong> </td><td>" . ($_POST['message']) . "</td></tr>"; | |
| $message .= "</table>"; | |
| $message .= '</html></body>'; | |
| $sent = mail($to, $subject, $message, $headers); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment