attach xml file to e-mail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
i want to make a program that reads data from database
and create a xml file. Then mail this file to someone
else...
there is no problem in creating file or mailing.
but when i open the attachment in e-mail, some
characters in xml tags disappear.
so recipient can't parse xml file in attachment.
for example in orijinal xml file

<member>
  <name>emrah</name>
  <surname>sener</surname>
</member>

in the attachment

<member>
  <name>emrah</name>
  <surname>sener</surame>(!!!)
</member>

is this problem about transfer encoding?
i try 7bit, 8bit, base64 ... but nothing happens...

$mime_boundary = "<<<--==+X[".md5(time())."]";

$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed;\r\n";
$headers .= " boundary=\"".$mime_boundary."\"";

$message .= "This is a multi-part message in MIME
format.\r\n";
$message .= "\r\n";
$message .= "--".$mime_boundary."\r\n";

$message .= "Content-Type: text/plain;
charset=\"iso-8859-1\"\r\n";
$message .= "Content-Transfer-Encoding: 8bit\r\n";
$message .= "\r\n";
$message .= "Transfer List: \r\n";
$message .= "--".$mime_boundary."\r\n";

$message .= "Content-Type: text/xml;
charset=\"iso-8859-1\"\r\n";
$message .= " name=".basename("transfer.xml")."\r\n";
$message .= "Content-Transfer-Encoding: 8bit\r\n";
$message .= "Content-Disposition: attachment;\r\n";
$message .= " filename=\"transfer.xml\"\r\n";
$message .= "\r\n";

$fp = fopen("transfer.xml","rb");

$message .=  fread($fp, filesize("transfer.xml"));

$message .= "\r\n";
$message .= "--".$mime_boundary."\r\n";

$go = mail("emrahsen51@xxxxxxxxx","XML Transfer",
$message, $headers);


thanks...



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux