Re: [PHP] Send mail using external server

2003-07-14 Thread Juan Nin
From: Maria Garcia Suarez [EMAIL PROTECTED]

 The problem is that blind copies
 don't reach destination, mails in the To: field arrive
 well, mails in the BCC: desappear and never reach the
 mailbox (nor get back :-?
[...]
talk2server(MAIL FROM: .$from.\n);
if (listen2server() == 250)
   talk2server(RCPT TO: .$to.\n);
   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;
 }

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..

regards,

Juan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Send mail using external server

2003-07-14 Thread Maria Garcia Suarez
Hola Juan!

Thanks for your help Juan :-)

A simple but must-be-asked question...

--- Juan Nin [EMAIL PROTECTED] wrote:
 From: Maria Garcia Suarez
 [EMAIL PROTECTED]
 
  The problem is that blind copies
  don't reach destination, mails in the To: field
 arrive
  well, mails in the BCC: desappear and never reach
 the
  mailbox (nor get back :-?
 [...]
 talk2server(MAIL FROM: .$from.\n);
 if (listen2server() == 250)
talk2server(RCPT TO: .$to.\n);
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;
  }
 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

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Send mail using external server

2003-07-14 Thread Juan Nin
From: Maria Garcia Suarez [EMAIL PROTECTED]


 Hola Juan!

Hola!  :)
(Hi!)

 Thanks for your help Juan :-)

de nada!!!
(you are welcome)

 What should I change in the script in order to make it
 work?

after the RCPT TO for the $to variable, you should check if $cc is
defined, if it is, then do the same for that variable, and then the same for
$bcc

also remember to remove the line I told before that adds the Bcc in the mail
headers...

but, IMHO, that script isn't well coded as you have already seen, and I also
don't like the way it's programmed, it's very rudimentary... I would use
phpmailer as someone told you before instead..

Besos!!!
(Kisses!)

Juan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Send mail using external server

2003-07-14 Thread Curt Zirzow
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



Re: [PHP] Send mail using external server

2003-07-14 Thread Curt Zirzow
Juan Nin [EMAIL PROTECTED] wrote:
 From: Maria Garcia Suarez [EMAIL PROTECTED]
 [...]

 but, IMHO, that script isn't well coded as you have already seen, and I also
 don't like the way it's programmed, it's very rudimentary... I would use
 phpmailer as someone told you before instead..

Agreed! :D

 
 Besos!!!
 (Kisses!)
 
 Juan
 

Curt
-- 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Send mail using external server

2003-07-14 Thread Maria Garcia Suarez
Hi there!

--- Curt Zirzow [EMAIL PROTECTED] wrote:
 Juan Nin [EMAIL PROTECTED] wrote:
  From: Maria Garcia Suarez
 [EMAIL PROTECTED]
  [...]
 
  but, IMHO, that script isn't well coded as you
  have already seen, and I also
  don't like the way it's programmed, it's very
  rudimentary... I would use
  phpmailer as someone told you before instead..
 Agreed! :D

Ok, thanks Pete, Juan  Curt for your help :-)  I'll
try that :-)

Kisses for you guys :-*

Maria


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Send mail using external server

2003-07-14 Thread Juan Nin
From: Curt Zirzow [EMAIL PROTECTED]


 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

good!! you also included the code for her  :)

 Be sure to remove the bcc header, it wont be very blind if the
 recipients can see who was blind carbon copied.

I'm really surprised at this script...

I can't believe someone posted that script for being downloaded while it has
several things that are completely wrong!!!
Specially the including the BCC in the header's in a way that anyone can see
it!!!

obviously this programmer did not have many clues on how SMTP works, and
didn't waste many of his time investigating it...
it really surprises me..

Juan






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Send mail using external server

2003-07-14 Thread Maria Garcia Suarez
Hi there!

--- Juan Nin [EMAIL PROTECTED] wrote:
 From: Curt Zirzow [EMAIL PROTECTED]
  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
 good!! you also included the code for her  :)

With the proposed changes does it become something
usable? I wouldn't like to start using a huge
(somehow, compared to this little script) script just
to send a very simple mail...

Thanks!

Kisses,
Maria

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Send mail using external server

2003-07-14 Thread Juan Nin
From: Maria Garcia Suarez [EMAIL PROTECTED]

 With the proposed changes does it become something usable?

it all depends on what you mean by usable!!!  :oP
if it works for what you want, and it satisfies your needs, then you can use
it

test it, and if it works ok for you, and don't want to use another one, well
just do it  :)

regards,

Juan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php