Re: mail function trouble

From: Date: Wed, 15 Nov 2000 01:12:22 +0000
Subject: Re: mail function trouble
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-25319@lists.php.net to get a copy of this message
On 14-Nov-00 Richard Lynch wrote: >> I am trying to get the php mail function to work as i want, my problem >> is that i need to separate some text with tabs but outlook seems to >> ignore my tabs (\t) in the body. What can the problem be? do i need to >> send a special content type? >> >> I tried the example on the manual, it's the same, no tabs only one >> space. > > There is little PHP can do to fix Outlook to actually honor the tab > character, especially since the end-user can choose a proporational font > where the tabs you are trying to use won't line stuff up anyway... > > \t is the tab character. If Outlook chooses to not represent that the way > you want, PHP ain't gonna be able to fix it. > > You could consider sending HTML-enhanced email, and using <PRE> or <TT> so > that the ASCII text will be a mono-spaced font, and maybe then Outlook would > do the right thing. > I havn't done this in PHP, but in Perl, (add the headers:) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="abcxyz" (a leader message) --abcxyz Content-Type: text/plain; charset=us-ascii PHP output is in the attachment ... (text output as a application type) --abcxyz Content-Disposition: attachment; filename="output.txt" Content-Transfer-Encoding: none Content-Type: application/octet-stream; name=output.txt this is the formated text output from your app, etc ... end of output. --abcxyz-- This should force Outlook run the notepad/wordpad thingy to view the output; (at least 'til the Boys from Redmond "Embrace & extend" the Internet again). Regards, -- Don Read dread@texas.net -- The problem with people who have no vices is that you can be sure they're going to have some pretty annoying virtues.

« previous php.general (#25319) next »