Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre><?php
- print_r($_POST);
- ?></pre>
- <?php
- require_once('../lib/phpmailer/class.phpmailer.php');
- include("../lib/phpmailer/class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
- $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
- $mail->IsSMTP(); // telling the class to use SMTP
- try {
- $contents = file_get_contents('mail-templates/OfferingMemorandum.php');
- foreach($_POST as $k => $v) {
- $contents = str_replace('{'.$k.'}', $v, $contents);
- }
- $mail->SMTPAuth = true; // enable SMTP authentication
- $mail->Host = "72.1.71.130"; // sets the SMTP server
- $mail->Port = 25; // set to standard SMTP port
- $mail->Username = "idint\noreply"; // SMTP account username
- $mail->Password = "K1tti352010!"; // SMTP account password
- $mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
- $mail->AddAddress('anthony@thejonesgroup.com', 'John Doe');
- $mail->SetFrom('noreply@idi.com', 'Sales Offering Memorandum');
- $mail->AddReplyTo('noreply@idi.com', 'No Reply');
- $mail->Subject = 'Sales Offering Memorandum - ' . $_POST['hidden_name'] . ' - ' . $_POST['hidden-property'];
- $mail->MsgHTML($contents);
- $mail->Send();
- echo "Message Sent OK</p>\n";
- } catch (phpmailerException $e) {
- echo $e->errorMessage(); //Pretty error messages from PHPMailer
- } catch (Exception $e) {
- echo $e->getMessage(); //Boring error messages from anything else!
- }
Add Comment
Please, Sign In to add comment