By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,353 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,353 IT Pros & Developers. It's quick & easy.

Sendmail PHP integration problem

P: n/a
Hi all,
I am using a simple php script to send a mail.

<?php
if (mail($to, $sub, $message, $from))
echo "sent mail successfully<br>\n";
?>

It GOES $to = "me@localhost.localdomain"

But NOT $to = "so*****@some.other.domain"

I use following configuration in php.ini
sendmail_path = "sendmail -v -t -i"

so I see "successfully delevery acceptance" in both case at verbose
messages.

However I CAN SEND messages to BOTH address successfully USING
telnet localhost 25

So what I feel is sendmail configuration works properly. But there is
a problem in interfacing sendmail and php.

Please help me to solve it out.

Thanks in advance - SB
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
can you post a bit more of your code?

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Sumith Bandula" <su****@cse.mrt.ac.lk> wrote in message
news:7a*************************@posting.google.co m...
Hi all,
I am using a simple php script to send a mail.

<?php
if (mail($to, $sub, $message, $from))
echo "sent mail successfully<br>\n";
?>

It GOES $to = "me@localhost.localdomain"

But NOT $to = "so*****@some.other.domain"

I use following configuration in php.ini
sendmail_path = "sendmail -v -t -i"

so I see "successfully delevery acceptance" in both case at verbose
messages.

However I CAN SEND messages to BOTH address successfully USING
telnet localhost 25

So what I feel is sendmail configuration works properly. But there is
a problem in interfacing sendmail and php.

Please help me to solve it out.

Thanks in advance - SB

Jul 17 '05 #2

P: n/a
Mike Bradley wrote:
can you post a bit more of your code?


In my real program I use bit complex set of codes. However after
realizing the problem I tested it with the given few lines of code. So
I don't have any more codes for this, but here is my real lines of
code.

<?php
if (mail("su****@localhost.localdomain", "test", "test", "From:
su****@localhost.localdomain"))
echo "Email 1 sent<br>\n";

if (mail("su****@cse.mrt.ac.lk", "test", "test", "From:
su****@cse.mrt.ac.lk"))
echo "Email 2 sent<br>\n";
?>

I get both "Email 1 sent" and "Email 2 sent" messages, but second mail
doesn't delever.

Anyhow I can send a mail to second address by TELNETing port 25.

Thanks a lot for your concern - SB
Jul 17 '05 #3

P: n/a
"Sumith Bandula" <su****@cse.mrt.ac.lk> wrote in message
news:7a*************************@posting.google.co m...
It GOES $to = "me@localhost.localdomain"

What about php.ini and variable "sendmail_from"?

uncle Ramp
Jul 17 '05 #4

P: n/a
You need to check your PHP.ini and make sure the
sendmail from variable is set to a valid address.
____________________________________
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
DigitallySmooth Inc. | Quick Site Studio
"Sumith Bandula" <su****@cse.mrt.ac.lk> wrote in message news:7a*************************@posting.google.co m...
Hi all,
I am using a simple php script to send a mail.

<?php
if (mail($to, $sub, $message, $from))
echo "sent mail successfully<br>\n";
?>

It GOES $to = "me@localhost.localdomain"

But NOT $to = "so*****@some.other.domain"

I use following configuration in php.ini
sendmail_path = "sendmail -v -t -i"

so I see "successfully delevery acceptance" in both case at verbose
messages.

However I CAN SEND messages to BOTH address successfully USING
telnet localhost 25

So what I feel is sendmail configuration works properly. But there is
a problem in interfacing sendmail and php.

Please help me to solve it out.

Thanks in advance - SB
Jul 17 '05 #5

P: n/a
"onu Ramp" <imeloom%20hot.ee> wrote in message news:<40*********************@diablo.uninet.ee>...

What about php.ini and variable "sendmail_from"?

As I know "sendmail_from" and "SMTP" are useful only in Windows.

I just commented it since I am using Linux.

Anyhow I tried with few options of these values as well. But couldn't succeed - SB
Jul 17 '05 #6

P: n/a
su****@cse.mrt.ac.lk (Sumith Bandula) wrote in message news:<7a*************************@posting.google.c om>...
<?php
if (mail($to, $sub, $message, $from))
echo "sent mail successfully<br>\n";
?>
It GOES $to = "me@localhost.localdomain"
But NOT $to = "so*****@some.other.domain">
Please help me to solve it out.


Finally I could solve it out. Thanks for all of you concern the
problem. Here is the simple change I did for the benifit of others who
might come across same type of problem.

Just add following line to the end of sendmail.mc file mostly
locateted in /etc/mail/

Cwmachinename.your.domain.name

Note that 'Cw' at the begining of above line.
Then run:

make -C /etc/mail

to reconfigure sendmail.cf. This might differ in different versions.

Finally thanks to all of you again - SB
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.