472,993 Members | 2,149 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

need to send email to 1000 addresses (currently in MS Excel)- what's the best way to do that, create a mail forma and paste ALL 1000 addresses in the TO field?

14 12797
Next time, try writing your message in the body, not in the subject line.
Also, as a common courtesy, please include your name, or at least your
handle, and email address. (It is smart to mask your email, such as "me AT
domain DOT com" so that webcrawlers can't add it to spam lists.) Lastly,
don't post a question that doesn't have anything to remotely do with PHP,
to the PHP group. Posting to the proper group will not only get you a
response faster, it will help keep the group on topic.

Thanks,
-Eric Kincl
Jul 17 '05 #2
PP
There is a message body to type in you know.

The best way is probably export it to a text file, an email address on every
line, then get the file in php using file() and send an email to each one
seperately.
--
Perfect Partner
http://www.PerfectPartner.tv/
Jul 17 '05 #3
Perhaps I did not post it correctly or explain myself well. Most people I
email appreciate putting the question in the subject line so they know what
I am asking for without reading the entire email. Live & learn.

I'd like to quickly develop a way send email to about 1000 people using php.
I thought about exporting the excel file to text then pasting & coding each
line as an array then looping through the array with mail().

Do you know of a quicker way?


"Eric Kincl" <Er**@Kincl.net_NO_SPAM_> wrote in message
news:3f******@news.gvsu.edu...
Next time, try writing your message in the body, not in the subject line.
Also, as a common courtesy, please include your name, or at least your
handle, and email address. (It is smart to mask your email, such as "me AT domain DOT com" so that webcrawlers can't add it to spam lists.) Lastly,
don't post a question that doesn't have anything to remotely do with PHP,
to the PHP group. Posting to the proper group will not only get you a
response faster, it will help keep the group on topic.

Thanks,
-Eric Kincl

Jul 17 '05 #4
NotGiven wrote:
Perhaps I did not post it correctly or explain myself well. Most people I
email appreciate putting the question in the subject line so they know
what
I am asking for without reading the entire email. Live & learn.

I'd like to quickly develop a way send email to about 1000 people using
php. I thought about exporting the excel file to text then pasting &
coding each line as an array then looping through the array with mail().

Do you know of a quicker way?


"Eric Kincl" <Er**@Kincl.net_NO_SPAM_> wrote in message
news:3f******@news.gvsu.edu...
Next time, try writing your message in the body, not in the subject line.
Also, as a common courtesy, please include your name, or at least your
handle, and email address. (It is smart to mask your email, such as "me

AT
domain DOT com" so that webcrawlers can't add it to spam lists.) Lastly,
don't post a question that doesn't have anything to remotely do with PHP,
to the PHP group. Posting to the proper group will not only get you a
response faster, it will help keep the group on topic.

Thanks,
-Eric Kincl


Hey,
I'm actually doing something to that extent right now. What it does is take
a string (from a textarea... it simply strips the \n tags so php sees it as
one huge string) and then it splits that string into an array of arrays.
(the way it works it could easily stand for rows and columns of an excel
sheet...) Here is the code I have so far. Keep in mind that I am actually
working on it this exact moment, and it may not be perfect, it seems to
work so far though for my means.

function string2namesArray(){
$Nsep = ";"; // Name separator
$FLsep = ","; // Last/First name Separator

if(isset($_REQUEST['names'])){
$names = $_REQUEST['names'];

// Compound the string - get rid of newlines, spaces, etc...
$names = str_replace(" ", "", $names);
$names = str_replace("\n", "", $names);
$names = str_replace("\r", "", $names);
// I forget which way it is on windows...
$names = str_replace("\n\r", "", $names);
$names = str_replace("\r\n", "", $names);
$names = str_replace("\t", "", $names);

// Strip last ";", if present
// the last ";" apparently causes an extra array index that is unnessasary
// BETA CODE
if(strrpos($names, $Nsep) == (strlen($names) - 1)){
$names = substr($names, 0, (strlen($names) - 1));
}
// END BETA CODE

$namesArray = explode($Nsep, $names); // Split on ";" and make array
$i = 0;
while($namesArray[$i]){
// split on "," and make an array inside of index [i]
// Since there can only be first/last name, make max array length 2
$namesArray[$i] = explode($FLsep, $namesArray[$i], 2);
$i++;
}
return $namesArray;
}
}

To give you an idea of what this program does, there is a textarea in which
a person can enter a set of names in the following syntax:
last, first;
It then takes this list, and puts it into an array of arrays as follows:
String = "last, first; last2, first2;"
Array
(
[0] => Array
(
[0] => last
[1] => first
)

[1] => Array
(
[0] => last2
[1] => first2
)

)
Newlines etc don't bother it. If you could modify this slightly (I think
you just have to get rid of the "2" in this line:
$namesArray[$i] = explode($FLsep, $namesArray[$i], 2);
And that should do it... Also change the $FLsep and $Nsep to be whatever
the row/column seperators are in the text file.

Lastly, don't send multiple e-mails. This takes up a ton of bandwidth on
your end. CC it, or even better, BCC it so that those being emailed can't
see the other peoples email addresses. I don't know how to BCC in PHP, or
even email in PHP. Check php.net for that info.

Good Luck,
-Eric Kincl
Jul 17 '05 #5
thanks

"Eric Kincl" <Er**@Kincl.net_NO_SPAM_> wrote in message
news:3f******@news.gvsu.edu...
NotGiven wrote:
Perhaps I did not post it correctly or explain myself well. Most people I email appreciate putting the question in the subject line so they know
what
I am asking for without reading the entire email. Live & learn.

I'd like to quickly develop a way send email to about 1000 people using
php. I thought about exporting the excel file to text then pasting &
coding each line as an array then looping through the array with mail().

Do you know of a quicker way?


"Eric Kincl" <Er**@Kincl.net_NO_SPAM_> wrote in message
news:3f******@news.gvsu.edu...
Next time, try writing your message in the body, not in the subject line. Also, as a common courtesy, please include your name, or at least your
handle, and email address. (It is smart to mask your email, such as "me
AT
domain DOT com" so that webcrawlers can't add it to spam lists.)
Lastly, don't post a question that doesn't have anything to remotely do with PHP, to the PHP group. Posting to the proper group will not only get you a
response faster, it will help keep the group on topic.

Thanks,
-Eric Kincl


Hey,
I'm actually doing something to that extent right now. What it does is

take a string (from a textarea... it simply strips the \n tags so php sees it as one huge string) and then it splits that string into an array of arrays.
(the way it works it could easily stand for rows and columns of an excel
sheet...) Here is the code I have so far. Keep in mind that I am actually working on it this exact moment, and it may not be perfect, it seems to
work so far though for my means.

function string2namesArray(){
$Nsep = ";"; // Name separator
$FLsep = ","; // Last/First name Separator

if(isset($_REQUEST['names'])){
$names = $_REQUEST['names'];

// Compound the string - get rid of newlines, spaces, etc... $names = str_replace(" ", "", $names);
$names = str_replace("\n", "", $names);
$names = str_replace("\r", "", $names);
// I forget which way it is on windows...
$names = str_replace("\n\r", "", $names);
$names = str_replace("\r\n", "", $names);
$names = str_replace("\t", "", $names);

// Strip last ";", if present
// the last ";" apparently causes an extra array index that is unnessasary // BETA CODE
if(strrpos($names, $Nsep) == (strlen($names) - 1)){
$names = substr($names, 0, (strlen($names) - 1));
}
// END BETA CODE

$namesArray = explode($Nsep, $names); // Split on ";" and make array $i = 0;
while($namesArray[$i]){
// split on "," and make an array inside of index [i] // Since there can only be first/last name, make max array length 2 $namesArray[$i] = explode($FLsep, $namesArray[$i], 2); $i++;
}
return $namesArray;
}
}

To give you an idea of what this program does, there is a textarea in which a person can enter a set of names in the following syntax:
last, first;
It then takes this list, and puts it into an array of arrays as follows:
String = "last, first; last2, first2;"
Array
(
[0] => Array
(
[0] => last
[1] => first
)

[1] => Array
(
[0] => last2
[1] => first2
)

)
Newlines etc don't bother it. If you could modify this slightly (I think
you just have to get rid of the "2" in this line:
$namesArray[$i] = explode($FLsep, $namesArray[$i], 2);
And that should do it... Also change the $FLsep and $Nsep to be whatever
the row/column seperators are in the text file.

Lastly, don't send multiple e-mails. This takes up a ton of bandwidth on
your end. CC it, or even better, BCC it so that those being emailed can't
see the other peoples email addresses. I don't know how to BCC in PHP, or
even email in PHP. Check php.net for that info.

Good Luck,
-Eric Kincl

Jul 17 '05 #6
"NotGiven" <no****@nonegiven.net> wrote in message
news:<1B***************@bignews3.bellsouth.net>...

need to send email to 1000 addresses (currently in MS Excel)-
what's the best way to do that, create a mail forma and paste
ALL 1000 addresses in the TO field?


Assuming your mailing is properly solicited, the "To: " field
should contain only one address, yours (just so that you can
confirm that the message has in fact been sent). Recipient's
addresses should go into the "Bcc: " field, separated by commas.
This way, the size of outgoing message will be smaller, plus
the receipients won't see who else received the mailing.

As to "the best way", you forgot to tell us one thing: the best
way to do WHAT? One-time mailing? Occasional mailings with
human-generated content? Periodic mailings with database-
generated content? Something else?

Cheers,
NC
Jul 17 '05 #7
Nikolai Chuvakhin wrote:
"NotGiven" <no****@nonegiven.net> wrote in message
news:<1B***************@bignews3.bellsouth.net>...
need to send email to 1000 addresses (currently in MS Excel)-
what's the best way to do that, create a mail forma and paste
ALL 1000 addresses in the TO field?

Assuming your mailing is properly solicited, the "To: " field
should contain only one address, yours (just so that you can
confirm that the message has in fact been sent). Recipient's
addresses should go into the "Bcc: " field, separated by commas.
This way, the size of outgoing message will be smaller, plus
the receipients won't see who else received the mailing.


Good to know that that kind of spam won't reach me, as SMTP is blocking BCC
mail, checking that the to address is really a user on the system to where the
mail is sent.

As to "the best way", you forgot to tell us one thing: the best
way to do WHAT? One-time mailing? Occasional mailings with
human-generated content? Periodic mailings with database-
generated content? Something else?


Just looking at the topic, seems to be one time spam and spam ain't nothing
that people wants to have.
//Aho

Jul 17 '05 #8
The best way is probably export it to a text file, an email address on every line, then get the file in php using file() and send an email to each one
seperately.


I've done this when running PHP as a command-line program
using telnet; however, I need to run the same program on a server with
only ftp access. When I run the program as a web page, the connection
times out before all of the E-mails are sent. So, I have no idea if
it made it through the list or not.

--
Don Adams
Jul 17 '05 #9
On 2003-11-20, Don Adams <dg*@sgi.com> wrote:
The best way is probably export it to a text file, an email address on

every
line, then get the file in php using file() and send an email to each one
seperately.


I've done this when running PHP as a command-line program
using telnet; however, I need to run the same program on a server with
only ftp access. When I run the program as a web page, the connection
times out before all of the E-mails are sent. So, I have no idea if
it made it through the list or not.


user@host: man screen

Or write a little resume function.

--
verum ipsum factum
Jul 17 '05 #10
Don Adams wrote:
The best way is probably export it to a text file, an email address on


every
line, then get the file in php using file() and send an email to each one
seperately.

I've done this when running PHP as a command-line program
using telnet; however, I need to run the same program on a server with
only ftp access. When I run the program as a web page, the connection
times out before all of the E-mails are sent. So, I have no idea if
it made it through the list or not.


As webservers has a timeout limit and the php.ini has one too, which makes
that scripts that takes to long without making any output will be timed out
and not preform the whole spamming.

Using Bbc: will increase the sped as you only send one mail, but luckylly SMTP
servers starts to filter away Bbc: mails, as thise are today used mostly only
by spammers (during a month 97% of all spam I got was Bbc:).
//Aho

Jul 17 '05 #11
jn
"J.O. Aho" <us**@example.net> wrote in message
news:bp*************@ID-130698.news.uni-berlin.de...
Don Adams wrote:
The best way is probably export it to a text file, an email address on
every
line, then get the file in php using file() and send an email to each oneseperately.

I've done this when running PHP as a command-line program
using telnet; however, I need to run the same program on a server with
only ftp access. When I run the program as a web page, the connection
times out before all of the E-mails are sent. So, I have no idea if
it made it through the list or not.


As webservers has a timeout limit and the php.ini has one too, which makes
that scripts that takes to long without making any output will be timed

out and not preform the whole spamming.

Using Bbc: will increase the sped as you only send one mail, but luckylly SMTP servers starts to filter away Bbc: mails, as thise are today used mostly only by spammers (during a month 97% of all spam I got was Bbc:).
//Aho


Good thing you can set the max_execution_time to "0" in an .htaccess file or
from within PHP :)
Jul 17 '05 #12
Right - it's a one time emailing to a known group of 1000 people. The email
addresses are curently in Excel.

"Nikolai Chuvakhin" <nc@iname.com> wrote in message
news:32**************************@posting.google.c om...
"NotGiven" <no****@nonegiven.net> wrote in message
news:<1B***************@bignews3.bellsouth.net>...

need to send email to 1000 addresses (currently in MS Excel)-
what's the best way to do that, create a mail forma and paste
ALL 1000 addresses in the TO field?


Assuming your mailing is properly solicited, the "To: " field
should contain only one address, yours (just so that you can
confirm that the message has in fact been sent). Recipient's
addresses should go into the "Bcc: " field, separated by commas.
This way, the size of outgoing message will be smaller, plus
the receipients won't see who else received the mailing.

As to "the best way", you forgot to tell us one thing: the best
way to do WHAT? One-time mailing? Occasional mailings with
human-generated content? Periodic mailings with database-
generated content? Something else?

Cheers,
NC

Jul 17 '05 #13
"NotGiven" <no****@nonegiven.net> wrote in message
news:<VO*****************@bignews1.bellsouth.net>. ..

it's a one time emailing to a known group of 1000 people.
The email addresses are curently in Excel.


Then why bother with PHP at all? Copy the Excel column
of e-mail addresses to Clipboard, paste it into any text
editor that can find end-of-line characters (incidentally,
Word will do), replace end-of-line characters with ', '
(comma plus space), copy to Clipboard again, and paste into
the "Bcc: " field of your regular e-mail software...

Cheers,
NC
Jul 17 '05 #14
Nikolai Chuvakhin wrote:
"NotGiven" <no****@nonegiven.net> wrote in message
news:<VO*****************@bignews1.bellsouth.net>. ..
it's a one time emailing to a known group of 1000 people.
The email addresses are curently in Excel.

Then why bother with PHP at all? Copy the Excel column
of e-mail addresses to Clipboard, paste it into any text
editor that can find end-of-line characters (incidentally,
Word will do), replace end-of-line characters with ', '
(comma plus space), copy to Clipboard again, and paste into
the "Bcc: " field of your regular e-mail software...

Cheers,
NC


And that, my freinds, deserves the "solution of the week" award ;)

he he he...
Jul 17 '05 #15

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

Similar topics

2
by: bill | last post by:
Hi All, When I send html content with Excel MIME type, the page break style sheet {page-break-before: always} doesn't work at Excel spreadsheet. Any idea to convert html page break style sheet to...
5
by: wylie72 | last post by:
I would like to redirect a form to output it's recordset to Excel rather than the Access report. I have the code to send SQL or a recordset to Excel, but how do I extract the datasource from the...
2
by: sunilkeswani | last post by:
I would like ms access to send out an email through outlook, with a speicific attachment, to a group of email IDs... Could someone please help with the code? I use MS Acess 2000 & Outlook 2000 ...
1
by: giesss | last post by:
I have been searching for a way to call a third party emailer to send mass emails from MS Access. Outlook thinks it is spam and asks the user to verify every email. I need to send many emails with an...
6
by: ad | last post by:
I have save a Excel file to MemoryStream. How can I send this MemoryStream to client's HD as a excel file?
6
by: mattc | last post by:
Hi, Writing a Macro in Excel and wanting to send emails automatically without this pop up box "A program is trying to automatically send email on your behalf". Is there some script I can use to...
5
by: fortwaynemarketplace | last post by:
Need these two scripts; 1. (Action) script for email (outlook express or...) to come up in .swf enviroment. I have created a button (email us), need action scritps to send/recevie an email. ....
3
by: Lloydm | last post by:
I built a timesheet and finally got all my functions working. Iv'e searched through the vb forum but had no luck finding a "print job" script. After saving file and before exit, I would like a...
1
by: edmundstephan | last post by:
Hi all. how do I write a macro or module to send the results (excel) of a query only if it has data in it? It must not send the file if no results were returned. I currently have a few Sendobject...
1
by: mohan21_kumar | last post by:
Hi, I'm using oldbd driver to retirve the data from an excel file. When the particular column of an excel is blank and filled with one record at the last row of an excel, all the column value...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.