Hello

I would like to see if anybody can help us with this error:

We have several sites using a form mail routine which was working fine on a server with PHP 4.1.3 installed

Now, we changed the sites to a new server with PHP 4.3.3 and when visitors submit the form the email is not going to the destiny.

Instead, the email is comnig to us as server managers with this title "Mail failure - malformed recipient address" and this message in the body:

A message that you sent contained one or more recipient addresses that were incorrectly constructed:

site_mail@domain.com <site_mail@domain.com>: malformed address: <site_mail@domain.com> may not follow site_mail@domain.com

This address has been ignored. There were no other addresses in your message, and so no attempt at delivery was possible.

------ This is a copy of your message, including all the headers. ------

Received: from nobody by internet.our_erver.net with local (Exim 4.24)
id 1BMUl4-0001At-Lr; Sat, 08 May 2004 12:33:02 -0400
To: site_mail@domain.com <site_mail@domain.com>
Subject: Nuevo Registro
From: domain.com <www.domain.com>
From: domain.com <www.domain.com@internet.our_server.net>
Message-Id: <E1BMUl4-0001At-Lr@internet.our_server.net>
Date: Sat, 08 May 2004 12:33:02 -0400

Nombre: Visitor´s name
Apellido: Visitor´s lastname
E-mail: vistitors_email
Submit: Enviar
PHP_MAIL_FORM: true

We are unsing mail() function to send these form-mails:

mail($this->to[$k]." <".$this->toEmail[$k].">", $this->subject, $this->body, "From: ".$this->from." <".$this->fromEmail.">\n".$this->headers);

Please HELP 😕

Thanks a lot!!!

Best Regards

    I had this problem a while back as well. It has to do with the Mail Transfer Agent handling the request. Some just can't handle that form of address (MS Exchange being a culprit in this). After spending weeks on the phone with the Exchange folks, and them never being able to find a solution, my only solution was to setup sendmail as a forwarder and pass it through there first. Sendmail will parse the address before sending it on.

    As a note, it does warn you about this on php's mail page.

      In your php.ini files, what have you got under [mail function]?

      I had to set SMTP to the IP of the exchange server (in this case it was the same server as the webserver). Does that help?

        Hello

        Thanks for you all for the answers

        I changed the SMTP server to our IP and still is not working 🙁

        We have this in the php.ini

        [mail function]
        ;SMTP = localhost ;
        SMTP = OUR.IP.ADDRESS ;
        ;sendmail_from = me@localhost.com ;
        sendmail_from = email@our_domain.net ;
        sendmail_path = /usr/sbin/sendmail -t -i ;

        What else can I do?

        Thanks again

          Write a Reply...