php-windows Digest 28 Jul 2004 12:34:08 -0000 Issue 2335

Topics (messages 24266 through 24269):

attach xml file to e-mail
        24266 by: emrahsen51.yahoo.com
        24267 by: Oliver John Tibi
        24268 by: Manuel Lemos

Truncating data
        24269 by: Ron.Herhuth.tatumpartners.com

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
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("[EMAIL PROTECTED]","XML Transfer",
$message, $headers);


thanks...



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

--- End Message ---
--- Begin Message ---
hi!

the encoding-type header do not matter unless you really endcode the xml attachment. try to encode the xml file by using PHP's base64_encode() function.

HTH. Peace!



Running 'ojtibi' on '127.0.0.1' (BATCH_OPTIMISTIC mode).
"Live free() or die()."





From: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] attach xml file to e-mail
Date: Tue, 27 Jul 2004 07:20:03 -0700 (PDT)

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("[EMAIL PROTECTED]","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


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
Hello,

On 07/27/2004 11:20 AM, [EMAIL PROTECTED] wrote:
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...

You would better not use 8 bit encoding without knowing if your local mailer supports it. It is safer to use quoted-printable encoding for text parts as all mailers support it.


If you do not know how to use it, you may want to try this class that you can use to compose and send messages including with non-ASCII text parts and attachments.

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Hey!

Okay I have a simple script that is nothing more than a query run against
a Microsoft SQL Server database which returns a VARCHAR(2400) field to
display in a text area field for user modification.  The problem is that
even though all of the data exists in the database, when it is displayed
in the Textarea not all the data is there.  I've taken care to make sure
that all quotes are taken care of and things like that, but it still
truncates the data.

This is driving me nuts...any assistance would be greatly appreciated!
Ron






--- End Message ---

Reply via email to