mail() -> doesn't work; complains "Recipient names must be specified"

This is a discussion on mail() -> doesn't work; complains "Recipient names must be specified" within the PHP Language forums, part of the PHP Programming Forums category; Hi All Sendmail 8.12.11 php 4.3.9 Sendmail is installed and works properly. php is NOT in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-13-2004
OldGuy
 
Posts: n/a
Default mail() -> doesn't work; complains "Recipient names must be specified"

Hi All

Sendmail 8.12.11
php 4.3.9

Sendmail is installed and works properly.
php is NOT in safemode

from the command line; mail user@domain.com < testmsg works fine.

Here is the code that I am trying.. Ideas?

$from='wiscripter@soundwifi.net';
$to='todh@yesterdayspc.com';
$subject='Test';
$body=`cat welcome.txt`;

# mail($to, $subject, $body, $from);
# print "$result\n";
mail("todh@yesterdayspc.com","junk","This is the body", \
"From: wiscripter@soundwifi.net");

Please note that I have tried BOTH mail() functions above with the same
results...

Reply With Quote
  #2 (permalink)  
Old 12-13-2004
Ken Robinson
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"


OldGuy wrote:
> Hi All
>
> Sendmail 8.12.11
> php 4.3.9
>
> Sendmail is installed and works properly.
> php is NOT in safemode
>
> from the command line; mail user@domain.com < testmsg works fine.
>
> Here is the code that I am trying.. Ideas?
>
> $from='wiscripter@soundwifi.net';
> $to='todh@yesterdayspc.com';
> $subject='Test';
> $body=`cat welcome.txt`;
>
> # mail($to, $subject, $body, $from);
> # print "$result\n";
> mail("todh@yesterdayspc.com","junk","This is the body", \
> "From: wiscripter@soundwifi.net");


Try:

$to = '<todh@yesterdayspc.com>';
$from = 'From: <wiscripter@soundwifi.net>';
mail($to,'Junk','Body lines',$from);
I believe you need the angle brackets around the addresses.

Ken

Reply With Quote
  #3 (permalink)  
Old 12-13-2004
OldGuy
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"


> Try:
>
> $to = '<todh@yesterdayspc.com>';
> $from = 'From: <wiscripter@soundwifi.net>';
> mail($to,'Junk','Body lines',$from);
> I believe you need the angle brackets around the addresses.
>
> Ken
>


Nope, mail($to,'junk','body lines',$from); still comes up with the
..subject complaint.

I think that I have tried all forms of variables:
"to: todh ...
"todh@ ...
'to: todh ...
'todh@ ... and it still complains about not having reciepents... I
believe that sendmail is complaining as I get:

Dec 13 08:57:24 yesterdays1 sendmail[17638]: iBDGvO59017638: from=root,
size=89, class=0, nrcpts=0,
msgid=<200412131657.iBDGvO59017638@yesterdays1.sou ndwifi.net>,
relay=root@localhost

Looks like the function is NOT passing arguments correctly?

todh

Reply With Quote
  #4 (permalink)  
Old 12-13-2004
Manuel Lemos
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"

Hello,

OldGuy wrote:
> Sendmail 8.12.11
> php 4.3.9
>
> Sendmail is installed and works properly.
> php is NOT in safemode
>
> from the command line; mail user@domain.com < testmsg works fine.
>
> Here is the code that I am trying.. Ideas?
>
> $from='wiscripter@soundwifi.net';
> $to='todh@yesterdayspc.com';
> $subject='Test';
> $body=`cat welcome.txt`;
>
> # mail($to, $subject, $body, $from);
> # print "$result\n";
> mail("todh@yesterdayspc.com","junk","This is the body", \
> "From: wiscripter@soundwifi.net");
>
> Please note that I have tried BOTH mail() functions above with the same
> results...


I think your message is sent but bounced to your root account. Check
your machine root mailbox and you will see.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Reply With Quote
  #5 (permalink)  
Old 12-13-2004
OldGuy
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"

Nope, box is empty. The sendmail log line ( only one ) shows that we
*tried* to send, but it wasn't accepted. ( status sent) is not shown.

Manuel Lemos wrote:
> Hello,
>
> OldGuy wrote:
>
>> Sendmail 8.12.11
>> php 4.3.9
>>
>> Sendmail is installed and works properly.
>> php is NOT in safemode
>>
>> from the command line; mail user@domain.com < testmsg works fine.
>>
>> Here is the code that I am trying.. Ideas?
>>
>> $from='wiscripter@soundwifi.net';
>> $to='todh@yesterdayspc.com';
>> $subject='Test';
>> $body=`cat welcome.txt`;
>>
>> # mail($to, $subject, $body, $from);
>> # print "$result\n";
>> mail("todh@yesterdayspc.com","junk","This is the body", \
>> "From: wiscripter@soundwifi.net");
>>
>> Please note that I have tried BOTH mail() functions above with the
>> same results...

>
>
> I think your message is sent but bounced to your root account. Check
> your machine root mailbox and you will see.
>


Reply With Quote
  #6 (permalink)  
Old 12-14-2004
Manuel Lemos
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"

Hello,

OldGuy wrote:
> Nope, box is empty. The sendmail log line ( only one ) shows that we
> *tried* to send, but it wasn't accepted. ( status sent) is not shown.


If it didn't bounce it is because it is still in the queue for a later
retry.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Reply With Quote
  #7 (permalink)  
Old 12-14-2004
OldGuy
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"

Nope, Queue is empty as is root's mail box. Complete strange.

I am gonna try on another php enabled box just to see if it does the
same stuff..

Will post

Manuel Lemos wrote:
> Hello,
>
> OldGuy wrote:
>
>> Nope, box is empty. The sendmail log line ( only one ) shows that we
>> *tried* to send, but it wasn't accepted. ( status sent) is not shown.

>
>
> If it didn't bounce it is because it is still in the queue for a later
> retry.
>


Reply With Quote
  #8 (permalink)  
Old 12-15-2004
Manuel Lemos
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"

Hello,

OldGuy said the following on 12/14/2004 05:07 PM:
> Nope, Queue is empty as is root's mail box. Complete strange.


The only circumstance when that happens is when the return address does
not correspond to a valid deliverable mailbox. I think it is set to to
root@localhost by default. You need to change that to an usable address.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Reply With Quote
  #9 (permalink)  
Old 12-15-2004
OldGuy
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"

Ok, tried the 'other box' -> RedHat 9 [ 2.4.20-30.9 ], sendmail 8.12.10,
php 5.0.0

here is the script ( linewraps -> be careful ) and I know yesterdays is
not spelled correctly.

<?php

session_start();

$MailTo = "todh@yestrdayspc.com";
$MailSub = "Test'n from DaBackup";
$Message = "NOW is the time for all good men to come to the aid of
their country.";

mail($MailTo, $MailSub, $Message );

print "And the other\n";

mail("todh@yestrdayspc.com","Test from DaBackup","Now is the time...");
?>

Does the same thing for BOTH of the mail() functions. Except this time
I got some other stuff from php...

Recipient names must be specified
Recipient names must be specified
Content-type: text/html
X-Powered-By: PHP/5.0.0
Set-Cookie: PPSESSION=[insert ye favorite mumbojumbo here]: path=/

I must be doing something really st00pid?

Manuel Lemos wrote:
[snip]
> The only circumstance when that happens is when the return address does
> not correspond to a valid deliverable mailbox. I think it is set to to
> root@localhost by default. You need to change that to an usable address.
>


root@localhost is a valid address. When sendmail encounters an invalid
sender AND the message bounces for some reason or another, postmaster is
notified and then forwarded to whom ever the alias points to ( root in
this case )

todh

Reply With Quote
  #10 (permalink)  
Old 12-15-2004
Sun
 
Posts: n/a
Default Re: mail() -> doesn't work; complains "Recipient names must be specified"

Hi,

I had some problem with PHP 5 on Solaris 8 OS. it reads the php.ini
file, but its not using the config variable.

finally I used PEAR mail module to sent e-mail.
you can find the sample code in php documet web site.

-SR

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:33 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0