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 Stefan Mueller on 11/23/05 18:30

> if you view the source of the resulting page you will find that
> <user@inter.net> is there... your browser is interpreting it as an
> html tag (although not a valid one) and not displaying it... if you
> want to display it use &lt; and &gt; rather than < and >
>
> as far as using the mail() function - the string $header you have
> created will work


You are great guy

I tried it almost the whole night - without success. Now I get
From: "User" <user@inter.net>
and that's really what I like to have. Many thanks.

Hmmm, I don't exactly understand why my browser was interpreting it as a
html tag. I think a PHP is running on the server side and not on the browser
side. Isn't it?
And anyway it was in "...". I don't understand, but it works.

However, I'm still not able to send an email

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "From: \"User\" &lt;user@inter.net&gt;\n";
$headers .= "Bcc: user2@inter.net\n";

The output of
echo $header
is like expected
MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 From:
"User" <user@inter.net> Bcc: user2@inter.net

The error message on my PHP server says:
[23-Nov-2005 17:12:40] PHP Warning: mail() [<a
href='function.mail'>function.mail</a>]: SMTP server response: 501 5.5.4
Invalid Address in C:\WWW\php\file.php on line 132

What's wrong? If I use
$headers .= "From: user@inter.net\n";
instead of
$headers .= "From: \"User\" &lt;user@inter.net&gt;\n";
is works perfect.

Stefan

 

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

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