473,791 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1564
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_nanoslee p()
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*******@attgl obal.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*******@attgl obal.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_nanosl eep()
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*******@attgl obal.net
=============== ===
Jul 29 '06 #8
"-Nacho-" <yo*********@ho tmail.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*********@ho tmail.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
5483
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
1
2768
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, there's a contact for that collects a few lines of info, and when you hit submit, it takes that and sends it to a specifie email address. It's been working all this time, but recently we just bought and implemented exchange 2003 on the server and...
34
18275
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 "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
0
3781
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, I do not know what should it be. If I Provide '0', it is throwing out error. Can any one help what shoudl I do to fix this. I am able to send E-mail sucessfully without Attachments.. Code (Please refer comments near Mailmessage.12) OPTIONS...
11
3521
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 programs capabilities. Searching this forum I did not find any related information so if I have chosen poorly, I would appreciate a suggestion of a more appropriate dotnet forum. Now what I wish is the ability to send bcc's rather than to: (would be...
0
1179
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. Suppose if we call using button click and manually we click button the error hasn't come. While sending throug automatic mail sending(Using manual button click) the user is prompted 'A program is trying automatically send e-mail on your behalf. Do...
3
3466
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 = "XXXXXXXXXXXX@XXXXXX.COM"
1
7000
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 below .... "DEBUG: setDebug: JavaMail version 1.4.1 DEBUG: getProvider() returning javax.mail.Provider DEBUG SMTP: useEhlo true, useAuth false
3
3399
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 customer with an email address a confirmation email in html or txt. Simple enough and very effective. Now I am editing this script to send a general email blast on a new computer... I have ActivePerl 5.10.0 Build 1003 installed. I downloaded...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.