/*
Please, only make changes to the following lines to change the date of the show
and the registration URL in the outgoing email...
*/
$dates = "October 19 - 20, 2011";
$reglink = "https://secure.landscapeontario.com/locc/showreg2.php?s=45";
include("tsnetfunctions.inc");
$title = "Expo Emailer";
if ($_REQUEST["command"] == "Send Message") {
if (!(is_email($_REQUEST["email"]))) {
$error .= "Email address entered is invalid. ";
}
elseif ($_REQUEST["companyname"] == "") {
$error .= "You must enter your company name. ";
}
elseif ($_REQUEST["booth"] == "") {
$error .= "You must enter your booth number. ";
}
else {
$supplied = preg_split("/s+/", $_REQUEST["emails"]);
$search = array("'", """, ",", ">“, “<", ";", ":");
$replace = "";
$destination = array();
$destination[] = "showinfo@loexpo.ca";
foreach ($supplied as $emailaddy) {
$emailaddy = str_replace($search, $replace, $emailaddy);
if (is_email($emailaddy)) {
$destination[] = $emailaddy;
}
}
if (count($destination) > 1) {
$headers .= “content-class: urn:content-classes:messagen”;
$headers .= “MIME-Version: 1.0n”;
$headers .= “Content-Type: multipart/related;n”;
$headers .= ” type=”multipart/alternative”;n”;
$headers .= ” boundary=”—-_=_NextPart_001_01C5DA39.EC99BBBA”n”;
$headers .= “X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0n”;
$headers .= “X-MS-Has-Attach: yesn”;
$headers .= “X-MS-TNEF-Correlator:n”;
$message = “This is a multi-part message in MIME format.nn”;
$message .= “——_=_NextPart_001_01C5DA39.EC99BBBAn”;
$message .= “Content-Type: multipart/alternative;n”;
$message .= ” boundary=”—-_=_NextPart_002_01C5DA39.EC99BBBA”nn”;
$message .= “——_=_NextPart_002_01C5DA39.EC99BBBAn”;
$message .= “Content-Type: text/plain;n”;
$message .= ” charset=”us-ascii”n”;
$message .= “Content-Transfer-Encoding: quoted-printablenn”;
$message .= “EXPO 2011n”;
$message .= “Canada’s Fall Retail Buying Show for the Green and Floral Industriesn”;
$message .= $dates . “n”;
$message .= “Toronto Congress Centre, Toronto, Canadann”;
$message .= wordwrap(strip_tags(stripslashes($_REQUEST[“message”])));
$message .= “nRegister Online for Expo 2011 at: ” . $reglink;
$message .= “and don’t forget to stop by booth ” . $_REQUEST[“booth”] . “to visit n”;
$message .= stripslashes($_REQUEST[“companyname”]) . “!nnnn”;
$message .= “This message has been generated by Landscape Ontario for n”;
$message .= stripslashes($_REQUEST[“companyname”]) . ” who is exhibiting at EXPO 2011 (formerly Garden & Floral Expo)n”;
$message .= “and felt that you should be invited. If you do not wish to receive any more ofn”;
$message .= “any more of these invitations, please contact ” . stripslashes($_REQUEST[“companyname”]) . “n”;
$message .= “and have your email address removed from their list. Landscape Ontario n”;
$message .= “is not responsible for any inappropriate use of this system.nn”;
$message .= “——_=_NextPart_002_01C5DA39.EC99BBBAn”;
$message .= “Content-Type: text/html;n”;
$message .= ” charset=”us-ascii”n”;
$message .= “Content-Transfer-Encoding: quoted-printablenn”;
$message .= “n”;
$message .= “
$message .= “n”;
$message .= “n”;
$message .= “n”;
$message .= “
n”;$message .= “
$message .= “ | |
|
$message .= “nn”;
$message .= “——_=_NextPart_002_01C5DA39.EC99BBBA–nn”;
$message .= “——_=_NextPart_001_01C5DA39.EC99BBBAn”;
$message .= “Content-Type: image/jpeg;n”;
$message .= “tname=”expo2011.jpg”n”;
$message .= “Content-Transfer-Encoding: base64n”;
$message .= “Content-ID: <957192714@26102005-2FA2>n”;
$message .= “Content-Description: expo2011.jpgn”;
$message .= “Content-Location: expo2011.jpgnn”;
$message .= chunk_split(base64_encode(file_get_contents(“images/expo2011.jpg”)));
$message .= “nn——_=_NextPart_001_01C5DA39.EC99BBBA–n”;
$headers .= “From: “”. stripslashes($_REQUEST[“companyname”]) . “” <" . $_REQUEST["email"] . ">n”;
foreach ($destination AS $emailaddress) {
mail($emailaddress, “See us at EXPO 2011™, $message, $headers);
if ($emailaddress != “showinfo@loexpo.ca”) {
print(“Emailed ” . $emailaddress . “
“);
}
}
?>All messages sent!
Back to the Expo web site
gefooter();
exit();
}
else {
$error .= "Could not find any valid destination email addresses.";
}
}
}
?>
if ($error != "") { ?> print($error); ?>
}
?>Using the form below, you can send an email to your customers inviting them to come and
see you at EXPO 2011. Simply fill in your company name, your own email address
and booth number and then cut and paste or type in a list of customer email addresses.
Invalid email addresses will be automatically discarded.
You also have the option to edit the text in the main body of the message. Your booth number and
company name are automatically generated at the bottom of the email when it is sent. If you want to
try it out, put in only your email address in the destination field.