469,332 Members | 6,612 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,332 developers. It's quick & easy.

Sendmail PHP integration problem

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
6 10070
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
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
"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
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
"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
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.

Similar topics

4 posts views Thread by lawrence | last post: by
2 posts views Thread by Babaloo | last post: by
reply views Thread by Aaron Powell | last post: by
4 posts views Thread by jim | last post: by
2 posts views Thread by mike | last post: by
1 post views Thread by James Robertson | last post: by
3 posts views Thread by swangdb | last post: by
4 posts views Thread by Nilesh | last post: by
4 posts views Thread by Clodoaldo | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.