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.

    <?php
    $mailtoyahoo=mail("to@yahoo.com", "Hi yahoo user!", "Hi, this is a test to ensure that mail to yahoo does indeed work.", "From: [email]me@me.com[/email]");
    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.

      Thx. Just sent a mail from my outlook express to yahoo mail thru my Linux box. My host is not on the black list.

        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.

          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.

            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. 🙂

              10 years later
              vizeta;10219120 wrote:

              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. 🙂

              I'm not to good with that part of asterisk, Can you tell me where exactly you put that in to php.ini file? Maybe screenshot?
              Thx

                commfunction;11020903 wrote:

                I'm not to good with that part of asterisk, Can you tell me where exactly you put that in to php.ini file? Maybe screenshot?
                Thx

                >implying the user is going to respond to a thread that's over a decade old

                  ...and wondering who said anything about asterisk.

                    Weedpacket;11020939 wrote:

                    ...and wondering who said anything about asterisk.

                    I meant linux (it is a asterisk machine)

                      Write a Reply...