473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

mail sending within a while failed

Hi all

I have a table with some email addresses of a mailing list subscribers.
I'm triying to send a mail to them by querying the table and sending
the mail from a 'while' loop, but I only get sent the mail to the first
address, and no more, and the 'while' is correct and I can see the
debug traces from within for each address.
I don't know if there is any reason for this, if the smtp server is
busy sending the first mail when receiving the second and next...

Anyone could help me, please?

Thanks in advance and kind regards.
-
Nacho

Jul 24 '06 #1
9 1549
On Sun, 23 Jul 2006 23:20:03 -0700, -Nacho- wrote:
Hi all

I have a table with some email addresses of a mailing list subscribers.
I'm triying to send a mail to them by querying the table and sending
the mail from a 'while' loop, but I only get sent the mail to the first
address, and no more, and the 'while' is correct and I can see the
debug traces from within for each address.
I don't know if there is any reason for this, if the smtp server is
busy sending the first mail when receiving the second and next...

Anyone could help me, please?

Thanks in advance and kind regards.
-
Nacho

Try slowing it down. If the load on a server gets too high, then the mail
server is designed to shut down.

Steve.

Jul 24 '06 #2
How can I slow it down to test it? I'm relatively new to php... :-S
Thanks, Steve.
-
Nacho
Steve ha escrito:
On Sun, 23 Jul 2006 23:20:03 -0700, -Nacho- wrote:
Hi all

I have a table with some email addresses of a mailing list subscribers.
I'm triying to send a mail to them by querying the table and sending
the mail from a 'while' loop, but I only get sent the mail to the first
address, and no more, and the 'while' is correct and I can see the
debug traces from within for each address.
I don't know if there is any reason for this, if the smtp server is
busy sending the first mail when receiving the second and next...

Anyone could help me, please?

Thanks in advance and kind regards.
-
Nacho


Try slowing it down. If the load on a server gets too high, then the mail
server is designed to shut down.

Steve.
Jul 24 '06 #3
Thanks, Noodle, but I've just tried out the solution with a sleep of 5
minutes and the problem persists. Only the first mail of the list is
sent. :(

-
Nacho

Noodle ha escrito:
Try experimenting with:

sleep()
http://www.php.net/manual/en/function.sleep.php

usleep()
http://www.php.net/manual/en/function.usleep.php

or

time_nanosleep()
http://www.php.net/manual/en/functio...-nanosleep.php
Jul 24 '06 #5
-Nacho- wrote:
Thanks, Noodle, but I've just tried out the solution with a sleep of 5
minutes and the problem persists. Only the first mail of the list is
sent. :(

-
Nacho

Noodle ha escrito:

>>Try experimenting with:

sleep()
http://www.php.net/manual/en/function.sleep.php

usleep()
http://www.php.net/manual/en/function.usleep.php

or

time_nanosleep()
http://www.php.net/manual/en/functio...-nanosleep.php

5 minutes is way too long. Most servers are set up to time out scripts
at 30 seconds or so.

Try 2-3 seconds and see if more go out. Or, if you have a lot, try one
of the mailing list programs freely available.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 24 '06 #6
I've been able to see that the problem is not due to time, but to the
object mail I use.

I use an object "mail" and I don't know how to kill it or to
deinstantiate it after the first mail sending, to be able to
instantiate it again for the next mails. This was hidden by the
requires so it was not returning any error msg, but I've created a
whole code embedding the code of the required files and now I get:

Cannot redeclare class mime_mail in
/home/transper/public_html/msend.php on line 52

Thanks
Jerry Stuckle ha escrito:
-Nacho- wrote:
Thanks, Noodle, but I've just tried out the solution with a sleep of 5
minutes and the problem persists. Only the first mail of the list is
sent. :(

-
Nacho

Noodle ha escrito:

>Try experimenting with:

sleep()
http://www.php.net/manual/en/function.sleep.php

usleep()
http://www.php.net/manual/en/function.usleep.php

or

time_nanosleep()
http://www.php.net/manual/en/functio...-nanosleep.php

5 minutes is way too long. Most servers are set up to time out scripts
at 30 seconds or so.

Try 2-3 seconds and see if more go out. Or, if you have a lot, try one
of the mailing list programs freely available.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 29 '06 #7
-Nacho- wrote:
Jerry Stuckle ha escrito:

>>-Nacho- wrote:
>>>Thanks, Noodle, but I've just tried out the solution with a sleep of 5
minutes and the problem persists. Only the first mail of the list is
sent. :(

-
Nacho

Noodle ha escrito:

Try experimenting with:

sleep()
http://www.php.net/manual/en/function.sleep.php

usleep()
http://www.php.net/manual/en/function.usleep.php

or

time_nanosleep()
http://www.php.net/manual/en/functio...-nanosleep.php

5 minutes is way too long. Most servers are set up to time out scripts
at 30 seconds or so.

Try 2-3 seconds and see if more go out. Or, if you have a lot, try one
of the mailing list programs freely available.
I've been able to see that the problem is not due to time, but to the
object mail I use.

I use an object "mail" and I don't know how to kill it or to
deinstantiate it after the first mail sending, to be able to
instantiate it again for the next mails. This was hidden by the
requires so it was not returning any error msg, but I've created a
whole code embedding the code of the required files and now I get:

Cannot redeclare class mime_mail in
/home/transper/public_html/msend.php on line 52

Thanks


(Top posting fixed)

Not being familiar with mime_mail (or even which version of mime_mail -
a quick Google search shows several of them) I can't help you. But
embedding files the second time is never the answer.

Where did you get the files? Do they have a support forum?

If not, you could try posting your failing code (not the redeclaration
error - the first error). It's impossible to tell what your problem is
without it.

P.S. Please don't top post. This group uses bottom posting as a standard.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 29 '06 #8
"-Nacho-" <yo*********@hotmail.comwrote:
I've been able to see that the problem is not due to time, but to the
object mail I use.

I use an object "mail" and I don't know how to kill it or to
deinstantiate it after the first mail sending, to be able to
instantiate it again for the next mails. This was hidden by the
requires so it was not returning any error msg, but I've created a
whole code embedding the code of the required files and now I get:

Cannot redeclare class mime_mail in
/home/transper/public_html/msend.php on line 52
This:

Class mime_mail { blah blah }

needs to be before your while loop.

Also make sure you are not include()ing the file containing this:

Class mime_mail { blah blah }

within your while loop.

miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu
Jul 29 '06 #9

Miguel Cruz ha escrito:
"-Nacho-" <yo*********@hotmail.comwrote:
I've been able to see that the problem is not due to time, but to the
object mail I use.

I use an object "mail" and I don't know how to kill it or to
deinstantiate it after the first mail sending, to be able to
instantiate it again for the next mails. This was hidden by the
requires so it was not returning any error msg, but I've created a
whole code embedding the code of the required files and now I get:

Cannot redeclare class mime_mail in
/home/transper/public_html/msend.php on line 52

This:

Class mime_mail { blah blah }

needs to be before your while loop.

Also make sure you are not include()ing the file containing this:

Class mime_mail { blah blah }

within your while loop.

miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu


Thanks, Miguel.
The problem was just there. I was invoking the class constructor within
the loop. I got the include() out of the loop and now everything is
working fine.

Thanks a lot!
-
Nacho

Jul 31 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: festivalman | last post by:
Hi, sorry if this is in the wrong spot. Finding the newsgroups on MS's site could have been easier Here's my problem I've got some old asp's that are running our simple web site. In a section,...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
0
by: bambi | last post by:
I am facing issues while adding attachments in an E-mail via Mapisend. The code I use is below. If I try to send , I am getting error messgae in Mailmessage.12. Mailmessage.12 is expected as numeric,...
11
by: Ed Bitzer | last post by:
I have been able using the namespace System.Web.Mail and its method Smtp.mail.send to mail simple text messages to a small group within our 55 and older community. I need help expanding the...
0
by: trram1972 | last post by:
Hi, One error has come while trying to send email automatically using the code snippet - Createdispatch failed w/error. This error is coming only when we are trying to call inside a function....
3
by: Prasad | last post by:
Hi all, I had to write a page in ASP which sends an email. I googled and was able to write the following code: <html> <body> <% Set Mail = Server.CreateObject("CDONTS.NewMail") Mail.To =...
1
dmjpro
by: dmjpro | last post by:
I am using SMTP mail server. I am sending a mail from SMTP client using Java Mail. But now i am getting this exception... Relaying denied. IP name possibly forged The debug informations given...
3
by: digitaldiva | last post by:
Hi I am new here and once upon a time I worked with Perl, now I am trying again and need some help: I wrote a Perl script a few years ago that opened an order entry TXT file and sent each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.