Jump to content

Recommended Posts

Posted

My new cable provider doesn't seem to be very good, and their Internet service will randomly drop out for about a minute. It doesn't happen a lot, but it tends to happen at the worst possible times.

 

I just tried to send an e-mail newsletter to all of my customers. My PC's Internet connection dropped right after I pressed the "send" button, so I got a web browser error instead of my mailer's confirmation page. I know that at least some of the e-mails were sent out because I have my own e-mail address near the top of the mailing list, and I received the message. The e-mail was sent using the mailer in the admin area of my site.

 

The PHP code for the mailer form page is very long, but I think this is the part that actually sends the e-mail:

 

$zcount = mysql_num_rows($res);

if ($zcount > 0) {

for ($i = 0; $i < mysql_num_rows($res); $i++) {

$email = mysql_result($res, $i, "email");

$messa = $_POST['message'];

$subj = $_POST['subject'];

$subj = stripslashes($subj);

$messa = stripslashes($messa);

mail($email, $subject, $messa, $email_headers);

 

Does the "for" loop in the PHP code run on my PC or on the server that hosts my site? In other words, since some of the e-mail addresses got the message, does that mean all of them got it even though my PC lost the connection while it was sending?

Posted

No PHP code runs locally on users computers.

 

It is impossible to tell how many of your users got it, unless it is quite a short list. The for loop would have run for as long as your connection was left open to the site...

Posted

There were around 70 people on the list. I don't want to send out another e-mail, because that would make my site look bad. Hopefully, everyone got the e-mail.

 

I never knew that PHP code ran on the users' computers. Why is it impossible to see the PHP code of a site if it runs on your own computer?

Posted
I never knew that PHP code ran on the users' computers. Why is it impossible to see the PHP code of a site if it runs on your own computer?

 

No PHP code runs locally on users computers.

 

PHP is Server-side is does not runs on a lusers machine

Posted
There were around 70 people on the list. I don't want to send out another e-mail, because that would make my site look bad. Hopefully, everyone got the e-mail.

 

I never knew that PHP code ran on the users' computers. Why is it impossible to see the PHP code of a site if it runs on your own computer?

 

Read what I wrote again, I said it doesn't run on users computers.

Posted
Read what I wrote again, I said it doesn't run on users computers.

 

Sorry, I misread your first post. In that case, everyone should have received the e-mail because the code only had to be executed once by my PC, right?

Posted
Sorry, I misread your first post. In that case, everyone should have received the e-mail because the code only had to be executed once by my PC, right?

 

NP :) it was a bit poorly written, quite tired atm.

 

Yes, but it had to be executed (and a connection maintained) for the full run of the script so if the server saw your connection dropped whilst halfway through the for loops then only half the people would have gotten it. If I where you I'd write a little log script in so you can tell in future.

Posted
can we subscribe to your newsletter?

 

Well, it wasn't really a newsletter. It was an announcement to the members of FiveHits.com which is one of the traffic exchanges I own. Anyone can subscribe to it if they have a web site to promote.

 

If I where you I'd write a little log script in so you can tell in future.

 

That's a great idea, thanks for the suggestion! The mailer's confirmation page usually says if there were any problems, but it never loaded because the connection had dropped. I suppose I could add some code that records each e-mail address as the mailer sends a message.

Posted

The only logs that GoDaddy gives me access to are the visitor logs with the GET requests. I would have to buy a dedicated server to have any further access.

Posted

I'd think it's (reasonably) safe to assume that your e-mails got through. Unless your PHP script took a completely unreasonable amount of time to finish, it's likely that apache would run the script until it had output, then die after it had found out the connection had dropped.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.