Click to See Complete Forum and Search --> : mail() to yahoo failed


vizeta
09-05-2002, 01:13 PM
Hi, I've a line looks like this:
<?
mail($email1,$subject,$message,$other);
?>

It works for hotmail and other mail server but not working at all for yahoo mail. It returns error by my mailserver below:

----- The following addresses had permanent fatal errors -----
danluk2000@yahoo.ca
(reason: 501 Syntax error in parameters or arguments)

----- Transcript of session follows -----
... while talking to mx1.mail.yahoo.com.:
>>> MAIL From:<apache@danluk> SIZE=84
<<< 501 Syntax error in parameters or arguments
501 5.6.0 Data format error

I did some search but still cannot figure out the solution. Please help. Thanks.

dotwebbie
09-05-2002, 01:33 PM
<?php
$mailtoyahoo=mail("to@yahoo.com", "Hi yahoo user!", "Hi, this is a test to ensure that mail to yahoo does indeed work.", "From: me@me.com");
if (!$mailtoyahoo) {
print("Try checking to see that your host has not blacklisted yahoo.");
}
else {
print("Success!");
}
?>


Of course change the values accordingly. This is to just make sure that it does indeed work.

vizeta
09-05-2002, 01:46 PM
Thx. Just sent a mail from my outlook express to yahoo mail thru my Linux box. My host is not on the black list.

dotwebbie
09-05-2002, 02:06 PM
Hm. Okay.

vizeta
09-05-2002, 02:16 PM
I found some different in header between the mail I sent by outlook and php.

By outlook (success):
Return-Path: <dan@founder.ca>

By php (fail):
Return-Path: <apache>

My question is how to change the value for it? php.ini? I didn't c any setting there. Thanks again.

dotwebbie
09-05-2002, 02:36 PM
Did you set the From: header in your mail with php? Do you run the server or does a host run it? It should be set to be root@yourdomain.com anyway . . . Do a phpinfo() and see what your settings are for mail.

vizeta
09-05-2002, 03:34 PM
It's me@localhost.com under sendmail_from variable. How do I change it? under php.ini?

vizeta
09-05-2002, 03:48 PM
Problem solved. What I did is define the setting of sendmail_path = /usr/sbin/sendmail -t -f webmaster@mydomain.com which is under php.ini. Thx everybody. :)

dotwebbie
09-05-2002, 04:07 PM
Good. :)