473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 us**@domain.com < testmsg works fine.

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

$f***************@soundwifi.net';
$t*******@yesterdayspc.com';
$subject='Test';
$body=`cat welcome.txt`;

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

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

Jul 17 '05 #1
14 22519

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 us**@domain.com < testmsg works fine.

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

$f***************@soundwifi.net';
$t*******@yesterdayspc.com';
$subject='Test';
$body=`cat welcome.txt`;

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


Try:

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

Ken

Jul 17 '05 #2
Try:

$to = '<to**@yesterdayspc.com>';
$from = 'From: <wi********@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=<20*************************@yesterdays1.sou ndwifi.net>,
relay=root@localhost

Looks like the function is NOT passing arguments correctly?

todh

Jul 17 '05 #3
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 us**@domain.com < testmsg works fine.

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

$f***************@soundwifi.net';
$t*******@yesterdayspc.com';
$subject='Test';
$body=`cat welcome.txt`;

# mail($to, $subject, $body, $from);
# print "$result\n";
mail("to**@yesterdayspc.com","junk","This is the body", \
"From: wi********@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
Jul 17 '05 #4
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 us**@domain.com < testmsg works fine.

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

$f***************@soundwifi.net';
$t*******@yesterdayspc.com';
$subject='Test';
$body=`cat welcome.txt`;

# mail($to, $subject, $body, $from);
# print "$result\n";
mail("to**@yesterdayspc.com","junk","This is the body", \
"From: wi********@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.


Jul 17 '05 #5
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
Jul 17 '05 #6
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.


Jul 17 '05 #7
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
Jul 17 '05 #8
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 = "to**@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("to**@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

Jul 17 '05 #9
Sun
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

Jul 17 '05 #10
Hello,

on 12/15/2004 12:09 PM OldGuy said the following:
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 = "to**@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("to**@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?


You are missing the headers of the message. These are really not
optional. You also need to set the return path address which is what
defines to where your messages should be bounced when they can't be
delivered. Message bounces often reveal problems in your system.

Have you tried this class? It can send messages correctly as needed so
you can confirm what is the problem as it sets the return path address
correctly if possible in your setup.

http://www.phpclasses.org/mimemessage
--

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
Jul 17 '05 #11
Hello,

on 12/15/2004 12:09 PM OldGuy said the following:
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 = "to**@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("to**@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?


You are missing the headers of the message. These are really not
optional. You also need to set the return path address which is what
defines to where your messages should be bounced when they can't be
delivered. Message bounces often reveal problems in your system.

Have you tried this class? It can send messages correctly as needed so
you can confirm what is the problem as it sets the return path address
correctly if possible in your setup.

http://www.phpclasses.org/mimemessage
--

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
Jul 17 '05 #12
Thanks Manuel

Just for your information I checked another box. I also have PHP
installed on another web server -> 4.3.8 with Apache 1.3.31 which works
with the below script. Real head scratcher now isn't it. Note that it
didn't matter if I had $Vars in the mail() structure, or the actual data
in quotes, mail went out as I expected.

The funny thing is that I have installed php, apache, sendmail ... etc
on multiple machines with no problems. When I get something working
properly, I continue with that exact config/install...etc until
something else is tested and working. Well, ok, until now with the
mail() issue.

I am going to give 4.3.10 a try to see if that does something else; like
maybe work?

I downloaded your class, will give it a try if PHP4.3.10 version doesn't
work for me.

todh

Manuel Lemos wrote:
Hello,

on 12/15/2004 12:09 PM OldGuy said the following:
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 = "to**@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("to**@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?

You are missing the headers of the message. These are really not
optional. You also need to set the return path address which is what
defines to where your messages should be bounced when they can't be
delivered. Message bounces often reveal problems in your system.

Have you tried this class? It can send messages correctly as needed so
you can confirm what is the problem as it sets the return path address
correctly if possible in your setup.

http://www.phpclasses.org/mimemessage


Jul 17 '05 #13
Hello,

on 12/15/2004 11:28 PM OldGuy said the following:
I am going to give 4.3.10 a try to see if that does something else; like
maybe work?

I downloaded your class, will give it a try if PHP4.3.10 version doesn't
work for me.


I think you making blind guesses of what is your problem. What you need
to do is to somehow set the return path address of the messages to an
address with a valid e-mail account. Once you figure that you will be
able to see why messages may be bouncing and figure your real problem.

That class will help you figuring how to set the return path address but
all it does is using plain PHP code.

--

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
Jul 17 '05 #14
>> I am going to give 4.3.10 a try to see if that does something else; like
maybe work?

I downloaded your class, will give it a try if PHP4.3.10 version doesn't
work for me.


I think you making blind guesses of what is your problem. What you need
to do is to somehow set the return path address of the messages to an
address with a valid e-mail account.


There are a lot of servers that will not accept an email with an
invalid return address. Some of them go to the effort to check the
return address by starting to send a bounce message to the server
referred to by the return address, stopping short of sending a
message body. If that fails, your message will not be accepted.

Also, if you have set your server to not accept bounce messages
(return envelope address of "<>"), your outgoing messages may
not be accepted.

Gordon L. Burditt
Jul 17 '05 #15

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

Similar topics

1
by: Station Media | last post by:
Hi, here my problem, i use stored procedure in ACCESS database(latest version), and i would like to use this procedure but it doesnt work, do you know why ? Procedure: PARAMETERS MyField Text...
1
by: nousha | last post by:
hi everybody, i have a dropdownlist in web application but it doesnt work if anybody met this problem before plz help me
3
by: Clouds | last post by:
Hi ! How do I add the dynamic event handler for a dropdownlist present in the itemtemplate of a datalist !! I am doing it in the itemdatabound event of the datalist but it doesnt work... I am...
9
by: nichas | last post by:
I tried to use #include<iostream> in visual C++ compiler but then it didnt work but i see this is the way it is being mentioned in C++ primer by lippman and lajoie.. where is the problem.. Do...
0
by: Juna | last post by:
I have been working in vs2003, but now started to work in vs2005 but the problem, I have simple web application not website, which work i mean open in browser when we press F5 or run the...
1
Digital Don
by: Digital Don | last post by:
I am writing a program for Peg solitaire... To check for no repetition of previous states I use a Set for storage of Board states.. The pronblem is when I declare the set as type char i.e. set...
3
by: jx2 | last post by:
hi guys i would appriciate your coments on this code - when i ran it for the very first time it doesnt see @last = LAST_INSERT_ID() but when i ran it next time it read it properly i need to know it...
1
by: Dany13 | last post by:
hi all. i using some text box for input value and some localvarible for passing this data to dataset . give instance for correct row of dataset and data in data table . use one gird view for...
20
by: Hush | last post by:
Hi, The following code works fine in IE7 but FF returns with an error: Access denied to achieve the property Element.firstChild. In this line: nodes = xmlDoc.documentElement.childNodes; My...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.