Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail sending/delivering order

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Hello,

I use the following to send 2 emails consecutively:

mail($mess_from_adr, "Message_1", $message_1, "From: $back_to_full", "-f $back_to_adr");
mail($mess_from_adr, "Message_2", $message_2, "From: $back_to_full", "-f $back_to_adr");

The problem is that, when testing it, I sometimes receive message_2 before message_1.

Is there a way I can force the server to deliver messages always in the right order?
 
No, there isn't.

PHP simply hands the message to its configured mail transfer agent. What the agent does after that gets pretty non-deterministic.

The only thing I can think of that might help is SMTP headers. Try adding the "X-Priority:" header to your messages, one high importance, one low. Maybe set the first to "X-Priority: 2 (high)" and the second to "X-Priority: 4 (low)" is lowest (highest is 1 and lowest is 5).

You might try adding a header of "Precedence: bulk" to the second message. ______________________________________________________________________
TANSTAAFL!
 
Thanks Sleipnir214, I'll try.
Have a good day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top