mail() & sendmail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zacky
Forum Newbie
Posts: 19
Joined: Fri Nov 29, 2002 6:08 am

mail() & sendmail

Post by zacky »

when I try to send a mail with the mail() function..
I get a error, in a mail to root..

Diagnostic-Code: SMTP; 550 cannot route to sender address <nobody@jalla.jalla.com>

what's wrong?

Here some more from the mail:

<<< 550 cannot route to sender address <nobody@jalla.jalla.com>
550 5.1.1 zacky@blah.com... User unknown :cry:
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

what code are you using to send it?
zacky
Forum Newbie
Posts: 19
Joined: Fri Nov 29, 2002 6:08 am

Post by zacky »

$mail = mail("zacky@blah.com", "subject", "jalla!");

8O
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

try this:

$email = "The email you want to send to";
$yemail = "Your email";
$body = "Hey

this is the message

and spaces will actually come out in the email";

mail("$email","Subject","$body","From:$yemail");

that will work.
zacky
Forum Newbie
Posts: 19
Joined: Fri Nov 29, 2002 6:08 am

Post by zacky »

no.. that din't work.. here's the error root get:


----- The following addresses had permanent fatal errors -----
zacky@blah.com
(reason: 550 rejected: cannot route to sender <nobody@jalla.jalla.com>)

----- Transcript of session follows -----
... while talking to mail.blah.com.:
>>> DATA
<<< 550 rejected: cannot route to sender <nobody@jalla.jalla.com>
554 5.0.0 zacky@blah.com... Service unavailable



jalla = server the script is sendt from.. (example name)
zacky@blah.com = example of email adress (yes, the email I use is working fine)
:cry:
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

Is your webserver windows or linux? Do you host yourself or by a company, if its by a company i'd be asking them, coz its definately a server issue.
zacky
Forum Newbie
Posts: 19
Joined: Fri Nov 29, 2002 6:08 am

Post by zacky »

no.. It's my linux box on my own line..
what's wrong?
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

I've tested that code over and over on BOTH my localhost server and on my paid hosting server and it works without a hitch.

Check your php.ini and server configs. Look for sendmail and mail functions especially.

I dont know much about server configs, so i'm not much of a help. sorry.
zacky
Forum Newbie
Posts: 19
Joined: Fri Nov 29, 2002 6:08 am

Post by zacky »

hmm.. ok..
I tried that script on my laptop, with qmail installed..
that worked.. but it din't work on the other linux box with net.

Do I have to have qmail(or something) installed if mail() should work ? :roll:
zacky
Forum Newbie
Posts: 19
Joined: Fri Nov 29, 2002 6:08 am

Post by zacky »

ok.. I found the problem.. (it was a server prob.)
tnx anyway 8)


It's working now :D
Post Reply