Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Source: http://www.binarytides.com/send-html-emails-php-mail-function/
- function html_mail($to, $subject, $message, $options)
- {
- if(isset($options['from_name']))
- {
- $headers = "From: " . $options['from_name'] . "<".$options['from_email'].">" . "rn";
- }
- $headers .= "Reply-To: ". strip_tags($_POST['req-email']) . "rn";
- //$headers .= "CC: someone@example.comrn";
- $headers .= "MIME-Version: 1.0rn";
- $headers .= "Content-Type: text/html; charset=ISO-8859-1rn";
- mail($to, $subject, $message, $headers);
- }
- $to = 'm00n.silv3r@gmail.com';
- $subject = 'Welcome to website';
- $from_name = 'Sunny';
- $from_email = 'no-reply@example.com';
- $message = '<html><body>';
- $message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
- $message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>Silver Moon</td></tr>";
- $message .= "<tr><td><strong>Email:</strong> </td><td>m00n.silv3r@gmail.com</td></tr>";
- $message .= "<tr><td><strong>Location:</strong> </td><td>Moon</td></tr>";
- $message .= "</table>";
- $message .= "</body></html>";
- html_mail($to, $subject, $message, array('from_email' => $from_email, 'from_name' => $from_name));
Add Comment
Please, Sign In to add comment