Example #1
0
$mailer->FromName = $site['from_name'];
if ($site['replyToEmail'] != '') {
    $mailer->AddReplyTo($site['replyToEmail'], $site['replyToName']);
}
// Add To addresses
for ($i = 1; $i <= count($site['to_email']); $i++) {
    $mailer->AddAddress($site['to_email'][$i - 1]);
}
//$mailer->AddAddress('*****@*****.**', 'Bill Leddy');
// add CC addresses
for ($i = 1; $i <= count($site['CC_email']); $i++) {
    $mailer->AddCC($site['CC_email'][$i - 1]);
}
// add BCC addresses
for ($i = 1; $i <= count($site['BCC_email']); $i++) {
    $mailer->AddBCC($site['BCC_email'][$i - 1]);
}
//$mailer->AddBCC('*****@*****.**', 'Bill Leddy');
if (trim($_POST['customer_email']) != '') {
    //Actually send the email
    if (!$mailer->Send()) {
        echo "Fail";
        // use this to dump the mailer info
        // look for ErrorInfo
        //print_r($mailer);
    } else {
        echo "Success";
    }
} else {
    echo "No email sent";
}
Example #2
0
            // Body
            $mailer->Body = $request;
            // Setup the from and Reply to
            $mailer->From = $fromAddress;
            //$mailer->FromName = $_POST['Name'];
            $mailer->AddReplyTo($_POST['email'], $_POST['Name']);
            // test that it took a little while for the customer to complete the form
            // If not, we assume it's spam
            $interval = time() - intval($_POST['Code']);
            if ($interval < 5) {
                $mailer->Subject = "Web Contact for " . gethostname() . " - Too fast: " . $interval;
                $mailer->AddAddress('*****@*****.**', 'Bill Leddy');
            } elseif ($CommentHasHttp_b === false) {
                // default to address is same as sender from config.php
                $mailer->AddAddress($site['from_email'], '');
                $mailer->AddBCC('*****@*****.**', 'Bill Leddy');
            } else {
                // this looks like spam
                $mailer->AddAddress('*****@*****.**', 'Bill Leddy');
            }
            if (!$mailer->Send()) {
                ?>
				<h3>Sorry, there is a problem with our email system.</h3>
				<pre><?php 
                echo $mailer->ErrorInfo . " ";
                ?>
</pre>
			<?php 
            } else {
                ?>
			    <div id="main">