Hi,
I've written a script that stores event details, submitted by the sites users.
Once I activate the listing I wish to send out an email with an attachment.
The script works fine if recieving mail in Outlook but not in a web based email client...
where am I going wrong?
$mail_subject = "Your event listing has been activated";
$mail_to = "$email";
$mail_body .= "$name \n\n";
$mail_body .= "Thanks for adding your event to our listings, your event is now on events listings page. \n\n";
$mail_body .= "Please find attached our agency roster, if you are interested in any of these djs, mcs or dancers please get in contact. you can also find more information online at \n\n";
$mail_body .= "You can advertise your event either on our home page, a banner at the top of our webpages, or in a e.flier to our email lists. There are many other ways of advertising if you would like more information and prices please contact us. \n\n";
$mail_boundary = md5(uniqid(time()));
$mail_headers .= "MIME-Version: 1.0\r\n";
$mail_headers .= "Content-type: multipart/mixed; boundary=\"$mail_boundary\"\r\n\r\n";
$mail_headers .= "This is a multi-part message in MIME format.\r\n\r\n";
$userfile = "../agency.doc";
$fp = fopen($userfile, "r");
$file = fread($fp, filesize($userfile));
$file = chunk_split(base64_encode($file));
$new_mail_body = "--$mail_boundary\r\n";
$new_mail_body .= "Content-type:text/plain;charset=$mail_charset\r\n";
$new_mail_body .= "Content-transfer-encoding:8bit\r\n\r\n";
$new_mail_body .= "$mail_body\r\n";
$new_mail_body .= "--$mail_boundary\r\n";
$mime_type = "application/msword";
$new_mail_body .= "Content-type:$mime_type;name=agency.doc\r\n";
$new_mail_body .= "Content-transfer-encoding:base64\r\n\r\n";
$new_mail_body .= $file . "\r\n\r\n";
$new_mail_body .= "--$mail_boundary--";
$mail_body = $new_mail_body;
mail($mail_to, $mail_subject, $mail_body, $mail_headers);
Please help!