Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am trying to use PHP's mail function to send an email, however in mail.log what I have is:

Apr 14 14:53:30 DynusT sendmail[31813]: p3EErUnA031813: from=www-data, size=259, class=0, nrcpts=1, msgid=<201104141453.p3EErUnA031813@DynusT>, relay=www-data@localhost
Apr 14 14:53:30 DynusT sm-mta[31814]: p3EErUjT031814: from=<www-data@DynusT>, size=464, class=0, nrcpts=1, msgid=<201104141453.p3EErUnA031813@DynusT>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Apr 14 14:53:30 DynusT sendmail[31813]: p3EErUnA031813: to=herlamba@email.arizona.edu, ctladdr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30259, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p3EErUjT031814 Message accepted for delivery)
Apr 14 14:53:31 DynusT sm-mta[31816]: STARTTLS=client, relay=mailgator.email.arizona.edu., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Apr 14 14:53:31 DynusT sm-mta[31816]: p3EErUjT031814: to=<herlamba@email.arizona.edu>, ctladdr=<www-data@DynusT> (33/33), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120464, relay=mailgator.email.arizona.edu. [128.196.133.156], dsn=4.1.8, stat=Deferred: 450 4.1.8 <www-data@DynusT>: Sender address rejected: Domain not found

What might be the problem? Why is it saying domain not found?

UPDATE:

here's the PHP code:

$to      = 'blah@email.state.edu';
        $subject = 'test';
        $message = 'test';
        $headers = 'From: mail@smartrek.blah.me' . "\r\n" .
                   'Reply-To: mail@smartrek.blah.me' . "\r\n" .
                    'X-Mailer: PHP/' . phpversion();

        mail($to, $subject, $message, $headers);
share|improve this question

2 Answers 2

It's saying the sender address that you've specified isn't validating to a correct email domain.

Looks like the from address might need a .com on the end.... a full, correct sender address is something like www-data@DynusT.com

share|improve this answer
    
this is weird because from my PHP code this is not the from that I have set. DynusT is the server name –  EquinoX Apr 14 '11 at 15:50
    
I know some hosting companies don't allow using certain php functions like mail(). It's possible the server is forcing certain php settings, including the from field when you use the mail() function, to prevent spoofing/spamming email scripts. –  MarkF Apr 14 '11 at 16:19
    
just confirmed that my host doesn't block php's mail function. The only possible reason is some configuration of the mail server and PHP. Care to give some advice where to look? –  EquinoX Apr 14 '11 at 16:31
    
Been a while since I've messed with it, but it's probably set to default to a specific from address in the php.ini file. Is it possible your host sets this variable and ignores if you change it in your code? Might also want to look at the documentation for mail(): php.net/manual/en/mail.configuration.php –  MarkF Apr 18 '11 at 22:49

As already noted DunsT is not a fully qualified name. It appears the mail server is not configured to correctly fixup the names submitted by your PHP code.

You need to configure the domain for sendmail to a fully qualified domain. See my article on Running and Email Server for some things to consider. I see far to much email from automated systems that looks like spam because of improper server configuration.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.