Click to See Complete Forum and Search --> : Send more than 1 e-mail from a script


JOSEMDF
01-02-2003, 06:24 AM
Hy all!!!
I'm trying to send an e-mail to 315 persons from a script.
First of all I had problems 'cause I couldn't send the
e-mail to more than 105 posts ¿¿¿???.
:confused:
So I tried to send 4 (3x100+1x15) e-mails from the same
Script BUT I couldn't,......
My script only opens the last e-mail ..........
what about the others???????
The code might help you more than my horrible English....
:cool:
I'm completely desperado........I need some help pleaseeeee

Thanks on advance....

<script>
function avisa(parametros)
{
var num=parametros.length;
var cientos=num/100;
var flag=0;
while(flag<cientos)
{
var to="";
var aux0=flag*100;
var pepe=cientos-flag;
if(pepe>=1)
{
var aux=100*(flag+1);
}
else
{
var aux=aux0+num%100;
}
for (cont=aux0;cont<aux;cont++)
{
to=to+parametros[cont]+"@tempe.es;";
}
var texto="Here is the text of the e-mail.";
var string="mailto:"+to+" subject=Example.&body= "+texto;
window.location=string;
flag++;
}
}
</script>

swon
01-02-2003, 06:42 AM
how much is parametros.length ? is it 315?

JOSEMDF
01-02-2003, 06:45 AM
EXACTLY!

swon
01-02-2003, 06:59 AM
function avisa(parametros)
{
var num=parametros.length;
var to="";
var texto="Here is the text of the e-mail.";
for(i=0;i<num;i++)
{
to=to+parametros[i]+"@tempe.es;";
var string="mailto:"+to+" subject=Example.&body= "+texto;
window.location=string;
}
}
</script>

Maybe there are things you need in your script, which I have deleted, then let me know.

JOSEMDF
01-02-2003, 08:42 AM
That´s not what I want......
I want to send 3x100 users mail and 1x15 users (total 315 users), and what you're suggesting is to send 1x315 users
e-mail.........
Any ideas???

swon
01-02-2003, 03:21 PM
Funny, but that makes 3x100 and 1x15:
for(i=0;i<100;i++)
{
to=to+parametros[i]+"@tempe.es;";
var string="mailto:"+to+" subject=Example.&body= "+texto;
window.location=string;
}

i=100;
for(i=100;i<200;i++)
{
to=to+parametros[i]+"@tempe.es;";
var string="mailto:"+to+" subject=Example.&body= "+texto;
window.location=string;
}
i=200;
for(i=200;i<300;i++)
{
to=to+parametros[i]+"@tempe.es;";
var string="mailto:"+to+" subject=Example.&body= "+texto;
window.location=string;
}
i=300;
for(i=300;i<315;i++)
{
to=to+parametros[i]+"@tempe.es;";
var string="mailto:"+to+" subject=Example.&body= "+texto;
window.location=string;
}

JOSEMDF
01-03-2003, 02:03 AM
Yes,...I know that code that you suggest is suposed to
do what I want but it doesn't (there's my problem)....
you can try it.......
the code that you suggest only "opens" last e-mail
(15 users only) and the rest .........¿?¿?¿¿?
So,.......here is my real problem......:(

swon
01-03-2003, 03:58 AM
Bad, I couldn't test it with some emailaddresses.
But maybe a mailto problem, who knows...

Do you use Server Side languages (PHP, ASP etc) ?
Think that is the best way to do something like that.

JOSEMDF
01-03-2003, 06:03 AM
Yes I'm using JSP, but I was trying to do it on JAVASCRIPT, so if I can´t I'll have to look on another way, I was just wondering about if it was possible to be done on JAVASCRIPT,but it seems that it gives so many problems......
:(

swon
01-03-2003, 06:09 AM
Yes, it seems to be to much for a normal mailto, but it is anyway better to make it with JSP, so don't worry ;-) !