You are here: Re: Why can't I create the string "User" <user@inter.net> « All PHP « IT news, forums, messages
Re: Why can't I create the string "User" <user@inter.net>

Posted by J.O. Aho on 11/24/05 08:37

Stefan Mueller wrote:
>>> If I use
>>> $headers .= "From: user@inter.net\n";
>>> instead of
>>> $headers .= "From: \"User\" &lt;user@inter.net&gt;\n";
>>> is works perfect.
>> &lt; and &gt; is only used to display < and > on a HTML page and not in
>> the
>> From: or To: in mail().
>>
>> so if you want to display the "header" variable and use it in your mail(),
>> then you need to use a function like eregi_replace to transform the < and
>> > to
>> &lt; and &gt; if you want to display the whole string.
>
> Wow, that makes sense.
> I don't want to display $headers I just like to send a mail. Therefore I
> tried
> $headers .= "From: \"User\" <user@inter.net>";
> or
>
> $headers .= "From: 'User' <user@inter.net>";
> or
>
> $headers .= "From: User <user@inter.net>";
> or
>
> $headers .= 'From: "User" <user@inter.net>';
>
> However, no version works.
>
> Does someone see what's still wrong?

$headers .="From: User <user@inter.net>\r\n";

For each line in the header you need \r\n, so that the MTA will know where
something ends.


//Aho

 

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

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