PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > little question about mail()
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
little question about mail()

Réponse
 
LinkBack Outils de la discussion
Vieux 12/02/2008, 13h37   #1
arnaud.icard@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut little question about mail()

Hi guys !

Here is my problem :

When I'm using the mail function with an html mail, everything goes
fine.
However, the first line displayed is always :

Message-ID: 1202822468-contact@xxx.xxx Date: Tue, 12 Feb 2008 14:21:08
+0100 (CET)

followed by the html mail well interpreted.
I guess that something wrong with the headers :

$headers = 'From: contact <contact@xxx.xxx>' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'Message-ID: ' . time() . '-contact@xxx.xxx' . "\r\n";


If I ever try to put the "MIME-version: 1.0" header, the html won't be
interpreted anymore...

Does someone could with that ??

Thanks
  Réponse avec citation
Vieux 12/02/2008, 13h54   #2
The Natural Philosopher
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: little question about mail()

arnaud.icard@gmail.com wrote:
> Hi guys !
>
> Here is my problem :
>
> When I'm using the mail function with an html mail, everything goes
> fine.
> However, the first line displayed is always :
>
> Message-ID: 1202822468-contact@xxx.xxx Date: Tue, 12 Feb 2008 14:21:08
> +0100 (CET)
>
> followed by the html mail well interpreted.
> I guess that something wrong with the headers :
>
> $headers = 'From: contact <contact@xxx.xxx>' . "\r\n" .
> 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
> 'Message-ID: ' . time() . '-contact@xxx.xxx' . "\r\n";
>
>
> If I ever try to put the "MIME-version: 1.0" header, the html won't be
> interpreted anymore...
>
> Does someone could with that ??
>
> Thanks

Looks like your system is rewriting the message-ID: header.

I suggest you look up the relevant RFC and ensure your message-id:
header is correctly formatted,then maybe it will leave it alone.


It is conventional to encapsulate the message-ID: value in <angle
brackets> It may be mandatory. Try it.


If you are faking your own mail headers, remember to put a blank line at
the end of them too.

The blank line means 'end of headers'

Any extra blank lines will push headers afterwards into the body text.
  Réponse avec citation
Vieux 12/02/2008, 14h04   #3
arnaud.icard@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: little question about mail()

On 12 fév, 14:54, The Natural Philosopher <a...@b.c> wrote:
> arnaud.ic...@gmail.com wrote:
> > Hi guys !

>
> > Here is my problem :

>
> > When I'm using the mail function with an html mail, everything goes
> > fine.
> > However, the first line displayed is always :

>
> > Message-ID: 1202822468-cont...@xxx.xxx Date: Tue, 12 Feb 2008 14:21:08
> > +0100 (CET)

>
> > followed by the html mail well interpreted.
> > I guess that something wrong with the headers :

>
> > $headers = 'From: contact <cont...@xxx.xxx>' . "\r\n" .
> > 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
> > 'Message-ID: ' . time() . '-cont...@xxx.xxx' . "\r\n";

>
> > If I ever try to put the "MIME-version: 1.0" header, the html won't be
> > interpreted anymore...

>
> > Does someone could with that ??

>
> > Thanks

>
> Looks like your system is rewriting the message-ID: header.
>
> I suggest you look up the relevant RFC and ensure your message-id:
> header is correctly formatted,then maybe it will leave it alone.
>
> It is conventional to encapsulate the message-ID: value in <angle
> brackets> It may be mandatory. Try it.
>
> If you are faking your own mail headers, remember to put a blank line at
> the end of them too.
>
> The blank line means 'end of headers'
>
> Any extra blank lines will push headers afterwards into the body text.


Well thanks for your response but "<" ">" did not work.
I've send the mail to my lotus notes mailbox and gmail box but same
problem here
  Réponse avec citation
Vieux 12/02/2008, 15h08   #4
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: little question about mail()

On Tue, 12 Feb 2008 15:04:56 +0100, <arnaud.icard@gmail.com> wrote:

> On 12 fév, 14:54, The Natural Philosopher <a...@b.c> wrote:
>> arnaud.ic...@gmail.com wrote:
>> > Hi guys !

>>
>> > Here is my problem :

>>
>> > When I'm using the mail function with an html mail, everything goes
>> > fine.
>> > However, the first line displayed is always :

>>
>> > Message-ID: 1202822468-cont...@xxx.xxx Date: Tue, 12 Feb 2008 14:21:08
>> > +0100 (CET)

>>
>> > followed by the html mail well interpreted.
>> > I guess that something wrong with the headers :

>>
>> > $headers = 'From: contact <cont...@xxx.xxx>' . "\r\n" .
>> > 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
>> > 'Message-ID: ' . time() . '-cont...@xxx.xxx' . "\r\n";

>>
>> > If I ever try to put the "MIME-version: 1.0" header, the html won't be
>> > interpreted anymore...

>>
>> > Does someone could with that ??

>>
>> > Thanks

>>
>> Looks like your system is rewriting the message-ID: header.
>>
>> I suggest you look up the relevant RFC and ensure your message-id:
>> header is correctly formatted,then maybe it will leave it alone.
>>
>> It is conventional to encapsulate the message-ID: value in <angle
>> brackets> It may be mandatory. Try it.
>>
>> If you are faking your own mail headers, remember to put a blank line at
>> the end of them too.
>>
>> The blank line means 'end of headers'
>>
>> Any extra blank lines will push headers afterwards into the body text.

>
> Well thanks for your response but "<" ">" did not work.
> I've send the mail to my lotus notes mailbox and gmail box but same
> problem here


What does the source of the mail tell you? And do you really need to set a
manual message-id? What if you leave it out? And allthough this is how it
should be done, any difference when using "\n" instead of "\r\n"?
--
Rik Wasmus
  Réponse avec citation
Vieux 12/02/2008, 15h59   #5
arnaud.icard@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: little question about mail()

On 12 fév, 16:08, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Tue, 12 Feb 2008 15:04:56 +0100, <arnaud.ic...@gmail.com> wrote:
> > On 12 fév, 14:54, The Natural Philosopher <a...@b.c> wrote:
> >> arnaud.ic...@gmail.com wrote:
> >> > Hi guys !

>
> >> > Here is my problem :

>
> >> > When I'm using the mail function with an html mail, everything goes
> >> > fine.
> >> > However, the first line displayed is always :

>
> >> > Message-ID: 1202822468-cont...@xxx.xxx Date: Tue, 12 Feb 2008 14:21:08
> >> > +0100 (CET)

>
> >> > followed by the html mail well interpreted.
> >> > I guess that something wrong with the headers :

>
> >> > $headers = 'From: contact <cont...@xxx.xxx>' . "\r\n" .
> >> > 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
> >> > 'Message-ID: ' . time() . '-cont...@xxx.xxx' . "\r\n";

>
> >> > If I ever try to put the "MIME-version: 1.0" header, the html won't be
> >> > interpreted anymore...

>
> >> > Does someone could with that ??

>
> >> > Thanks

>
> >> Looks like your system is rewriting the message-ID: header.

>
> >> I suggest you look up the relevant RFC and ensure your message-id:
> >> header is correctly formatted,then maybe it will leave it alone.

>
> >> It is conventional to encapsulate the message-ID: value in <angle
> >> brackets> It may be mandatory. Try it.

>
> >> If you are faking your own mail headers, remember to put a blank line at
> >> the end of them too.

>
> >> The blank line means 'end of headers'

>
> >> Any extra blank lines will push headers afterwards into the body text.

>
> > Well thanks for your response but "<" ">" did not work.
> > I've send the mail to my lotus notes mailbox and gmail box but same
> > problem here

>
> What does the source of the mail tell you? And do you really need to set a
> manual message-id? What if you leave it out? And allthough this is how it
> should be done, any difference when using "\n" instead of "\r\n"?
> --
> Rik Wasmus


YES ! Using "\n" instead of "\r\n" is the tips !

Thanks a lot for your guys
  Réponse avec citation
Vieux 12/02/2008, 17h42   #6
The Natural Philosopher
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: little question about mail()

arnaud.icard@gmail.com wrote:
> On 12 fév, 16:08, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Tue, 12 Feb 2008 15:04:56 +0100, <arnaud.ic...@gmail.com> wrote:
>>> On 12 fév, 14:54, The Natural Philosopher <a...@b.c> wrote:
>>>> arnaud.ic...@gmail.com wrote:
>>>>> Hi guys !
>>>>> Here is my problem :
>>>>> When I'm using the mail function with an html mail, everything goes
>>>>> fine.
>>>>> However, the first line displayed is always :
>>>>> Message-ID: 1202822468-cont...@xxx.xxx Date: Tue, 12 Feb 2008 14:21:08
>>>>> +0100 (CET)
>>>>> followed by the html mail well interpreted.
>>>>> I guess that something wrong with the headers :
>>>>> $headers = 'From: contact <cont...@xxx.xxx>' . "\r\n" .
>>>>> 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
>>>>> 'Message-ID: ' . time() . '-cont...@xxx.xxx' . "\r\n";
>>>>> If I ever try to put the "MIME-version: 1.0" header, the html won't be
>>>>> interpreted anymore...
>>>>> Does someone could with that ??
>>>>> Thanks
>>>> Looks like your system is rewriting the message-ID: header.
>>>> I suggest you look up the relevant RFC and ensure your message-id:
>>>> header is correctly formatted,then maybe it will leave it alone.
>>>> It is conventional to encapsulate the message-ID: value in <angle
>>>> brackets> It may be mandatory. Try it.
>>>> If you are faking your own mail headers, remember to put a blank line at
>>>> the end of them too.
>>>> The blank line means 'end of headers'
>>>> Any extra blank lines will push headers afterwards into the body text.
>>> Well thanks for your response but "<" ">" did not work.
>>> I've send the mail to my lotus notes mailbox and gmail box but same
>>> problem here

>> What does the source of the mail tell you? And do you really need to set a
>> manual message-id? What if you leave it out? And allthough this is how it
>> should be done, any difference when using "\n" instead of "\r\n"?
>> --
>> Rik Wasmus

>
> YES ! Using "\n" instead of "\r\n" is the tips !
>
> Thanks a lot for your guys

Then something in PHP is not sending the headers correctly. "\r\n" is
strictly RFC822.

I found something stupidly similar when I used mail()..it double spaced
everything.

I bet it expands bot \r and \n to \r\n or something stoopid.



  Réponse avec citation
Vieux 12/02/2008, 18h37   #7
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: little question about mail()

On Tue, 12 Feb 2008 18:42:37 +0100, The Natural Philosopher <a@b.c> wrote:

> arnaud.icard@gmail.com wrote:
>> On 12 fév, 16:08, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>>> On Tue, 12 Feb 2008 15:04:56 +0100, <arnaud.ic...@gmail.com> wrote:
>>>> On 12 fév, 14:54, The Natural Philosopher <a...@b.c> wrote:
>>>>> arnaud.ic...@gmail.com wrote:
>>>>>> Hi guys !
>>>>>> Here is my problem :
>>>>>> When I'm using the mail function with an html mail, everything goes
>>>>>> fine.
>>>>>> However, the first line displayed is always :
>>>>>> Message-ID: 1202822468-cont...@xxx.xxx Date: Tue, 12 Feb 2008
>>>>>> 14:21:08
>>>>>> +0100 (CET)
>>>>>> followed by the html mail well interpreted.
>>>>>> I guess that something wrong with the headers :
>>>>>> $headers = 'From: contact <cont...@xxx.xxx>' . "\r\n" .
>>>>>> 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
>>>>>> 'Message-ID: ' . time() . '-cont...@xxx.xxx' . "\r\n";
>>>>>> If I ever try to put the "MIME-version: 1.0" header, the html won't
>>>>>> be
>>>>>> interpreted anymore...
>>>>>> Does someone could with that ??
>>>>>> Thanks
>>>>> Looks like your system is rewriting the message-ID: header.
>>>>> I suggest you look up the relevant RFC and ensure your message-id:
>>>>> header is correctly formatted,then maybe it will leave it alone.
>>>>> It is conventional to encapsulate the message-ID: value in <angle
>>>>> brackets> It may be mandatory. Try it.
>>>>> If you are faking your own mail headers, remember to put a blank
>>>>> line at
>>>>> the end of them too.
>>>>> The blank line means 'end of headers'
>>>>> Any extra blank lines will push headers afterwards into the body
>>>>> text.
>>>> Well thanks for your response but "<" ">" did not work.
>>>> I've send the mail to my lotus notes mailbox and gmail box but same
>>>> problem here
>>> What does the source of the mail tell you? And do you really need to
>>> set a
>>> manual message-id? What if you leave it out? And allthough this is how
>>> it
>>> should be done, any difference when using "\n" instead of "\r\n"?

>> YES ! Using "\n" instead of "\r\n" is the tips !
>> Thanks a lot for your guys

> Then something in PHP is not sending the headers correctly. "\r\n" is
> strictly RFC822.
>
> I found something stupidly similar when I used mail()..it double spaced
> everything.
>
> I bet it expands bot \r and \n to \r\n or something stoopid.


Mostly, this isn't PHP, but a borked MTA.
--
Rik Wasmus
  Réponse avec citation
Vieux 12/02/2008, 21h55   #8
axlq
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: little question about mail()

In article <6cd81278-9341-4ea3-8622-918d66e640ca@d70g2000hsb.googlegroups.com>,
<arnaud.icard@gmail.com> wrote:
>
>If I ever try to put the "MIME-version: 1.0" header, the html won't be
>interpreted anymore...


The problems I had with mail() were solved by using the phpmailer class
from http://sourceforge.net/project/showf...group_id=26031

-A
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18027 seconds with 16 queries