PHP Classes

problem when i try to send to more then 1 person

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  problem when i try to send to more...  >  (Un) Subscribe thread alerts  
Subject:problem when i try to send to more...
Summary:problem when i try to send to more then 1 person
Messages:8
Author:Hugo Barreiros
Date:2007-07-01 16:37:03
Update:2007-09-10 11:40:48
 

  1. problem when i try to send to more...   Reply   Report abuse  
Picture of Hugo Barreiros Hugo Barreiros - 2007-07-01 16:37:04
im having some problems when i send the message to more then 1 person :s i get a message from gmail saying

Technical details of permanent failure:
PERM_FAILURE: Parse Error: Illegal To: address (invalid domain name):

in the debug i get
C RCPT TO:<xx@gmail.com,xx@mac.com>

what is the problem? how can i fix this? :S

  2. Re: problem when i try to send to more...   Reply   Report abuse  
Picture of Neerav Modi Neerav Modi - 2007-07-01 17:16:16 - In reply to message 1 from Hugo Barreiros
Are you supplying to To addresses as an array?

  3. Re: problem when i try to send to more...   Reply   Report abuse  
Picture of Hugo Barreiros Hugo Barreiros - 2007-07-01 18:00:19 - In reply to message 2 from Neerav Modi
yes

array(
xxx@gmail.com, xx@gmail.com
),

  4. Re: problem when i try to send to more...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-01 18:06:14 - In reply to message 1 from Hugo Barreiros
You should provide the recipients as separate entries of the recipients array argument of the SendMessage call.

Anyway, it is more recommended that you use the MIME message class to compose the messages correctly according to the mail standards. It comes with smtp_message_class that uses the smtp_class to deliver messages.

phpclasses.org/mimemessage

  5. Re: problem when i try to send to more...   Reply   Report abuse  
Picture of Hugo Barreiros Hugo Barreiros - 2007-07-01 18:10:20 - In reply to message 3 from Hugo Barreiros
and when i dont use array i get

Cound not send the message to xxx@gmail.com, xxx@mac.com. Error: 553 5.1.2 Bad or missing RCPT domain c25sm12420126ika

  6. Re: problem when i try to send to more...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-01 19:36:06 - In reply to message 5 from Hugo Barreiros
Please do as I tell you. It is:

array(
'xxx@gmail.com',
'xx@gmail.com'
)

and not

array(
'xxx@gmail.com, xx@gmail.com'
)

  7. Re: problem when i try to send to more...   Reply   Report abuse  
Picture of Hugo Barreiros Hugo Barreiros - 2007-07-01 19:56:33 - In reply to message 6 from Manuel Lemos
Ok obrigado :)

  8. Re: problem when i try to send to more...   Reply   Report abuse  
Picture of Mandakini Mandakini - 2007-09-10 11:40:48 - In reply to message 6 from Manuel Lemos

I am using SMTP E-mail sending class in our script but not sure how it will help me. My server is linux. Now my project flow is link this :

Step 1) I have few tables that having around 90000 records. This records contains email address, firstname, lastname ,country etc. These variable may be part of (email address, firstname, lastname ,country ) message send to users.

Step 2) Now I use while loop to get all email address and other variables e.g. email address, firstname, lastname ,country from database.

Step 3) within while loop I am writing this script



if($smtp->SendMessage(
$from,
array(
$to
),
array(
"From: $from",
"To: $to",
"Subject: Testing Manuel Lemos' SMTP class",
"Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z")
),
"Hello $to,\n\nIt is just to let you know that your SMTP class is working just fine.\n\nBye.\n"))
echo "Message sent to $to OK.\n";
else
echo "Cound not send the message to $to.\nError: ".$smtp->error."\n";





Now my question are:

A)Is it right way to use your script ?

if yes

Why should we use such a big script why don't go for simple email() function. what's use of var $maximum_piped_recipients=100; I hope this is for piping i.e. for parall operation.

If No

Please guide me to how can I send 80k or 90k emails. My current script get stuck after 1000 email send.

Can I use body and subject in array() format ? if yes where I need to modify in smtp class


Thanks