Go Down

Topic: Email Timing Issue (Read 2 times) previous topic - next topic

Pauly

Hi,
I have a project that uses an Arduino & a WiShield to connect to my home network.
This then sends me an email via a PHP page at regular intervals like twice a day.
The email contains a timestamp. 
Sometimes I don't get the email until hours later, but it always has the right timestamp.
The PHP page is on a server on the Internet, not inside my home.
What would cause the email to be delayed for hours?
Is this a PHP or server issue?

Thanks.


Coding Badly

Well, there is the usual suspect.  Misbehaving internet service provider.

Are you closing the session to the email server cleanly?  I vagualy recall that sending email requires a "quit" when finished.

bld

How are you sending it?

With php it should be as simple as
Code: [Select]
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";

if (mail($to, $subject, $body))
{
   echo("<p>Message successfully sent!</p>");
}
else
{
   echo("<p>Message delivery failed...</p>");
}

I am using this with success myself.

Are you sending more than just a few emails with this daily? Wondering if there could be some kind of limit on it, so it can't be used for spam.
captain-slow.dk | non contagious!

Coding Badly

I forgot about "mail".  Ignore my post.

Pauly

I am using the following :
if ( mail($tot,$subject,$message,$headers,"From: $from\nContent-Type: text/html; charset=iso-8859-1") ) {

   echo "Yahoo!";
   } else {
   echo "The email has failed!";
   }

Go Up