viralpatel.info
News: www.viralpatel.info >> blog <new> !
Blog


21-Mar-2008

php


Twitt this! Email this!

PHP Related

Let us first list down a few must read links for PHP.

  1. PHP Documentation : http://www.php.net/manual/en/

List of companies working in PHP (India)
Note: The list is in random order (will be updated as and when I came to know about new ones).
Feel free to add few as comments.
Company Name Website Product / Project CMM Level Location
Yahoo www.yahoo.com Product - Banglore
Directi www.directi.com Product - Mumbai
Guruji www.guruji.com Product - Banglore
Hurix www.hurix.com Project 5 Mumbai









03-Mar-2008

SMTP Mail Headers


Twitt this! Email this!

SMTP Mail Headers

Ever thought of how your email travels through internet ?
Well, here I have tried to explain it via example in a little technical terms
Email message passes with a chunk of information about the email.
This information is called Mail Headers.

This is an example of how e-mail headers work.


This example is fetched from RFC 2822 : Internet Message Format to get a glimpse of the format of e-mails
Part 1 : Simple Mail Transfer

Simple Flow of the example


MAIL1 : From USER1 to USER2
MAIL2 : From USER2 to USER1 as Reply of MAIL1
MAIL3 : From USER1 to USER2 as Reply of MAIL2
--------------------------------------------------
Mail Conversation Headers

Have a close look at Message-ID and References fields also...

Scene 1 : John Sends a Mail to Mary (MAIL1)

----
From: John Doe
To: Mary Smith
Subject: Saying Hello
Date: Fri, 21 Nov 1997 09:55:06 -0600
Message-ID: <[email protected]>

This is a message just to say hello.
So, "Hello".
----


When sending replies, the Subject field is often retained, though prepended with "Re: "

Scene 2 : Mary Sends a Reply Mail to John, (Note : She has a different Reply-To Address) (MAIL2)

----
From: Mary Smith
To: John Doe
Reply-To: "Mary Smith: Personal Account"
Subject: Re: Saying Hello
Date: Fri, 21 Nov 1997 10:01:10 -0600
Message-ID: <[email protected]>
In-Reply-To: <[email protected]>
References: <[email protected]>

This is a reply to your hello.
----


Note the "Reply-To:" field in the above message. When John replies
to Mary's message above, the reply should go to the address in the
"Reply-To:" field instead of the address in the "From:" field.

Scene 3 : John Sends a Reply Mail to Mary @ her Reply-To Address (MAIL3)

----
To: "Mary Smith: Personal Account"
From: John Doe
Subject: Re: Saying Hello
Date: Fri, 21 Nov 1997 11:00:00 -0600
Message-ID:
In-Reply-To: <[email protected]>
References: <[email protected]> <[email protected]>

This is a reply to your reply.
----

Part 2 : Resent (Forward) Mail Transfer

This example shows how the Resent (Forwarded) E-mail messages works.


Resent messages (Forward Messges)

Scene 1 : John sends a mail to Mary

----
From: John Doe
To: Mary Smith
Subject: Saying Hello
Date: Fri, 21 Nov 1997 09:55:06 -0600
Message-ID: <[email protected]>

This is a message just to say hello.
So, "Hello".
----


Say that Mary, upon receiving this message, wishes to send a copy of
the message to Jane such that
(a) the message would appear to have come straight from John;
(b) if Jane replies to the message, the reply should go back to John; and
(c) all of the original information, like the date the message was originally sent to Mary,
the message identifier, and the original addressee, is preserved.
In this case, resent fields are prepended to the message:

Scene 2 : Mary resents(forwards) the mail to Jane

----
Resent-From: Mary Smith
Resent-To: Jane Brown
Resent-Date: Mon, 24 Nov 1997 14:22:01 -0800
Resent-Message-ID: <[email protected]>
From: John Doe
To: Mary Smith
Subject: Saying Hello
Date: Fri, 21 Nov 1997 09:55:06 -0600
Message-ID: <[email protected]>

This is a message just to say hello.
So, "Hello".
----


Scene 3: Jane resents(forwards) the mail to another person
If Jane, in turn, wished to resend this message to another person,
she would prepend her own set of resent header fields to the above
and send that.

----

Resent-From: Jane Brown
Resent-To: Mary Smith
Resent-Date: Wed, 26 Nov 1997 18:20:01 -0800
Resent-Message-ID: <[email protected]>
Resent-From: Mary Smith
Resent-To: Jane Brown
Resent-Date: Wed, 26 Nov 1997 18:20:01 -0800
Resent-Message-ID: <[email protected]>
From: John Doe
To: Mary Smith
Subject: Saying Hello
Date: Fri, 21 Nov 1997 09:55:06 -0600
Message-ID: <[email protected]>

This is a message just to say hello.
So, "Hello".
----