Maria Garcia Suarez <[EMAIL PROTECTED]> wrote: > > [...] > > > talk2server("MAIL FROM: ".$from."\n"); > > > if (listen2server() == "250") > > > talk2server("RCPT TO: ".$to."\n");
You must send the rctp to's bfore you start sending the data. To be a more stable smtp client there should be more sanity checking before blindy doing this: if ($cc != "") { $CC = split(',', $cc); foreach ($CC as $ccemal) { talk2server("RCPT TO: $ccemail\n"); } } Then repeat for BCC's > > > if (listen2server() == "250") > > > talk2server("DATA\n"); > > > if (listen2server() == "354") > > > { > > > $content = "Subject: $subject\r\n"; > > > $content .= "From: $from\r\n"; > > > $content .= "To: $to\r\n"; > > > if ($cc!="") { > > > $content .= "Cc: $cc\r\n"; > > > } > > > if ($bcc!="") { > > > $content .= "Bcc: $bcc\r\n"; > > > } Be sure to remove the bcc header, it wont be very blind if the recipients can see who was blind carbon copied. > > the problem is that the script should send a "RCPT > > TO" for every recipient, > > and it only send it for $to > > so this script only works with the $to field, > > neither the $cc nor $bcc will > > work... > > moreover, the "$content .= "Bcc: $bcc\r\n";" line > > should not go!!! > > if not you are putting the info about the BCC in the > > mail headers and > > everyone will be able to see it.. > > What should I change in the script in order to make it > work? > > Thanks a lot for your help. > > Besos, > Maria > Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php