No sorry, both messages are the same.
Didn't mean to post it twice. Sorry.
Below is what prints out when I echo the message:
$to
robinwilson@xxxxxxxxxxxx
$subject
Proposal Submission
$headers
From: 2HostMe Mailer Reply-To: Robin Wilson Return-Path: 2HostMe Mailer
Message-ID: X-Mailer: PHP v4.4.2 MIME-Version: 1.0 Content-Type:
multipart/related; boundary="d49718178131ebc038c576f007a40642"
$msg
--d49718178131ebc038c576f007a40642 Content-Type: image/gif;
name="betaresource.gif" Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="betaresource.gif"
R0lGODlhWgAeAPcAAAAAAP///25scFNdc1tkc0tcclpibWNpcTtbgi1CWzJIY0BaeyU0RjpRbCw9
UUFXci8/UkxbbUpUYGdwe3Z7gRMqQxg1VB5AZh0+YjpWdjhTcjVNaTBGXjRLZSY3Si1BVzxVcUpn
iE1rizpQaTJEWTZJXzlNYzFCVUBUajhGVVJlezdDUGNyglNdaBUvShEmPBo5Wh9EaiBGbBs7XCFI
byNMdCJJcR9CZxw8XSFFaiJHbCNJbiBCZChReiZOdSVLcSBBYR8+XSRHaSJDYypQdSdKbSVGZiI3
TSU6UDtcfSk/VkNliUVkhD9bdyk6TENeekpmgkNbdDxPY1NtiEhedTtNXzhJWk1ke0theEVXajA9
SkJTZE5hdGx+kFxremx2gH6DiBYxSyVNcxo2USlUfB9AXh08WCpWfidQdSJGZhcvRSlTeSpUeh06
VB89WRozShkxRyZJaS1VeylOcCpQchkvRC1UeCVFYi1SdTBYfCM/Wi1QcStNbDBUdUVqi0Riflt5
lFdzjEZbb1t1jT9OXGJ2iUJPW1dlcoiVoSxagitZgC9gii5dhjNlkTdtmjVqlTRjjDtvmTptljFb
fyRDXi9XeTlpkDVhhTlmjCpKZkBulD1lh05yj01rhF55j1NqfWuHnmN8kmmBlUpaZ4aaq32PnniI
loKPmiVIYj53oz5ym0R8pS5SbUN2nWGFoG6SrVZvgltzhlJndzxLV2V7jJKqvIKVpGx7hoqbqJGg
q46bpTFadkuDqoahtHSCjImUn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JOI7zOA8wB2jAXHIwBwkABHPw
A0WQXMr1A2ygCI3gCI3QAz9AA28zXQPDA9N1AY4ZBBiQhRiQAz9QA6NTBHKQA96JAU6SAEYmsAEb
wAcKIIMasADqmQFzwxHumQR3gwJxaQBesF2DoAIoQJ4bEBAAOw== Content-Type:
multipart/alternative --d49718178131ebc038c576f007a40642 Content-Type:
text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Dear Robin
Wilson Below are the details of the Proposal Submission Form you filled in
at 2HostMe Media Services Logo / produktnaam test Thema / slogan:
Steekwoorden* Aantal (ca.): Kleur item: Budget (minimum en maximum prijs in
euros) tussen euro en euro per produkt item Gewenste leverdatum 27-01-2007
Streef Datum Eventueel eigen produkt ideeën Opmerkingen / aanvullende info
Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Dear Robin Wilson
Below are the details of the Proposal Submission Form you filled in at
2HostMe Media Services
Logo / produktnaam test
Thema / slogan:
Steekwoorden*
Aantal (ca.):
Kleur item:
Budget (minimum en maximum prijs in euros) tussen euro en euro per produkt
item
Gewenste leverdatum 27-01-2007 Streef Datum
Eventueel eigen produkt ideeën
Opmerkingen / aanvullende info
--d49718178131ebc038c576f007a40642--
""Jake McHenry"" <linux@xxxxxxxxxxxxxxxxx> wrote in message
news:083e01c76dbf$f5627500$6401a8c0@xxxxxxxxxxxxx
I take it there are no errors... And your using windows... Sending to
exchange... I guess with seeing what you posted, I would start by echoing
out what you have in $to, $subject, $msg, $headers. Are there any errors
in
Exchange logs? Do you see the message coming into Exchange queue?
Jake
-----Original Message-----
From: Robin Wilson [mailto:robinwilson@xxxxxxxxxxxx]
Sent: Friday, March 23, 2007 9:53 PM
To: php-general@xxxxxxxxxxxxx
Subject: What is wrong with this function please?
Hello
I'm trying to do a function that emails users and sends an
attachment. But I
think something is in the wrong order or something as when I send it
Exchange discards it.
This is the function which I have put together from various sources:
I would really appreciate any help as I have been up half the
night and got
nowhere!
Thanks
Robin
function sendMail($to, $toName, $from, $fromName, $subject, $message,
$uploadfile, $fileName, $fileType, $fileSize) {
$eol="\r\n";
$mime_boundary=md5(time());
# Common Headers
$headers .= 'From: '. $fromName .' <'. $from .'>'.$eol;
$headers .= 'Reply-To: '. $toName .' <'. $to .'>'.$eol;
$headers .= 'Return-Path: '. $fromName.' <'. $from
.'>'.$eol; // these
two to set reply address
$headers .= "Message-ID:
<".$mime_boundary."@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol;
// These two to
help avoid spam-filters
# Boundry for marking the split & Multitype Headers
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-Type: multipart/related;
boundary=\"".$mime_boundary."\"".$eol;
$msg = " ";
if ($uploadfile != "") {
# File for Attachment
$file_name = substr($uploadfile, (strrpos($uploadfile,
"/")+1));
$handle=fopen($uploadfile, 'rb');
$f_contents=fread($handle, $fileSize);
$f_contents=chunk_split(base64_encode($f_contents));
//Encode The
Data For Transition using base64_encode();
fclose($handle);
# Attachment
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: ".$fileType.";
name=\"".$file_name."\"".$eol;
$msg .= "Content-Transfer-Encoding: base64".$eol;
$msg .= "Content-Disposition: attachment;
filename=\"".$file_name."\"".$eol.$eol; // !! This line needs
TWO end of
lines !! IMPORTANT !!
$msg .= $f_contents.$eol.$eol;
}
# Setup for text OR html
$msg .= "Content-Type: multipart/alternative".$eol;
# Text Version
$msg .= "--".$mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= strip_tags(str_replace("<br>", "\n", $message)).$eol.$eol;
# HTML Version
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
$msg .= $message.$eol.$eol;
# Finished
$msg .= "--".$mime_boundary."--".$eol.$eol; // finish
with two eol's for
better security. see Injection.
// Mail it
mail($to, $subject, $msg, $headers);
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release
Date: 3/22/2007 7:44 AM
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/730 - Release Date: 3/22/2007
7:44 AM
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php