You are here: Re: mail() problem - not formatting correctly « PHP Programming Language « IT news, forums, messages
Re: mail() problem - not formatting correctly

Posted by Jerry Stuckle on 04/14/06 21:26

chris wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:tbudnWdrZZJIDKLZnZ2dnUVZ_v6dnZ2d@comcast.com...
>
>>chris wrote:
>>
>>>My code
>>><?php
>>>$name = "freddie";
>>>
>>>$message.="Hi Joe,\n";
>>>$message.="\t $name has Filled out the form on the Website,\n";
>>>$message.="The information from the form is listed below:\n";
>>>$message.="more info\n";
>>>$message.="more info\n";
>>>
>>>mail("email address", "subject",$message,"FROM:email address");
>>>?>
>>>
>>>when this is run the email recieved is formatted :
>>>Hi Joe,
>>> freddie has Filled out the form on the Website, The information
>>>from
>>>the form is listed below:
>>>more info
>>>more info
>>>
>>>
>>>
>>>i would expect it to be formatted :
>>>
>>>Hi Joe,
>>> freddie has Filled out the form on the Website,
>>>The information from the form is listed below:
>>>more info
>>>more info
>>>
>>>
>>>
>>>Does anyone have any idea why this happens ???
>>>
>>>
>>>--
>>
>>Chris,
>>
>>Hmmm, I haven't seen this problem before, although I have used mail() a
>>fair amount.
>
>
> i see it from time to time but havent been able to work out why
>
>
>>Some thoughts - first of all, what happens if you change the \t to a
>>couple of spaces? Does that change things?
>
>
> i have tried it without the \t also without the commer
>
>
>
>>Also, what does the message's source look like? Is it possible your mail
>>reader is reformatting and you don't know it?
>>
>>Finally - did you copy/paste the code, or did you retype it? If the
>>latter, did you accidentally correct your "problem" when retyping? :-)
>>
>>But no - you do NOT want to insert html code into your message -
>>especially the header.
>
>
> i thought about doing it in html but dont want to go down that road
>
>
Chris,

Another thought. Before you send the message, write out everything - headers,
message, everything - to a database. Then when you get a bad message, go back
to the database to see what was actually sent to mail(). That should give you a
better idea of whether the problem is in your message itself or the mail command.

I'm just wondering if a spammer may be trying to add a BCC: field or something
similar to see if he can break your form.

Even if not - at least you'll see the raw data - maybe it will help.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация