Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id="test" method="post" action="employment-applicationreceived.php">
- <div class="backgroundform">
- <li id="li_1" >
- <label class="description2" for="element_1">Name: </label>
- <input id="req_name" name= "req_name" class="element text" maxlength="255" size="28" value=""/>
- </form>
- <?php
- require_once "Mail.php";
- require_once "Mail/mime.php";
- $from = "Test <test@testing.com>";
- $to = "Test <test@testing.com>";
- $subject = "Test HTML email using PHP Pear w/ SMTPrnrn";
- $text = "This is a text test email message";
- $html = "<html><body><html><body>
- <strong>PERSONAL INFORMATION</strong>
- <table>
- <tr style='background: #999;'><td height='2'></td><td>
- <tr><td>First Name: </td><td width='500'>$req_name = $_POST['req_name'];</td>
- </table></body></html>";
- $crlf = "n";
- $mime = new Mail_mime($crlf);
- $mime->setTXTBody($text);
- $mime->setHTMLBody($html);
- $host = "hostname";
- $port = "25";
- $username = 'test@testing.com';
- $password = '***';
- $headers = array ('From' => $from,
- 'To' => $to,
- 'Subject' => $subject);
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
- $body = $mime->get();
- $headers = $mime->headers($headers);
- $mail = $smtp->send($to, $headers, $body);
- if (PEAR::isError($mail)) {
- echo("
- " . $mail->getMessage() . "
- ");
- } else {
- echo("
- Message successfully sent!
- ");
- }
- ?>
Add Comment
Please, Sign In to add comment