Solved

Sending emails on PHP isn't working correctly (centos)

Posted on 2014-12-21
11
254 Views
Last Modified: 2014-12-21
Hello, I've recently set up a new website http://minecraftcommunity.org/ and everything has worked so far exept the email sending trough php. If you for example try to register http://minecraftcommunity.org/register or contacting http://minecraftcommunity.org/register no emails are being sent away. And I do have configuered the php.ini correctly. So I wonder how to fix this issue.

php.ini
[mail function]
; For Win32 only.
; http://www.php.net/manual/en/mail.configuration.php#ini.smtp
SMTP = localhost
; http://www.php.net/manual/en/mail.configuration.php#ini.smtp-port
smtp_port = 25

; For Win32 only.
; http://www.php.net/manual/en/mail.configuration.php#ini.sendmail-from
sendmail_from = Mail@minecraftcommunity.org

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://www.php.net/manual/en/mail.configuration.php#ini.sendmail-path
sendmail_path = /var/www/mail -t -i

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originaiting-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; Log all mail() calls including the full path of the script, line #, to address and headers
mail.log = /var/www/error

Open in new window

0
Comment
Question by:johandrex
  • 6
  • 5
11 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40511610
And what is in your error log?
Do you install Postfix?
0
 

Author Comment

by:johandrex
ID: 40511613
Is it required to have postfix when sending mail in php? Because postfix isn't startable for me.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40511615
Whats in the logs?

When you installed Centos did you not install a GUI like ISPConfig?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:johandrex
ID: 40511623
--------------------- Postfix Begin ------------------------

        6   *Fatal:   General fatal
 
        2   Postfix start        
 
 
 
 **Unmatched Entries**
        1   Dec 19 20:24:14 ns331757 postfix/postfix-script[1198]: warning: not owned by postfix: /var/lib/postfix/./master.lock
        1   Dec 19 20:24:03 ns331757 postfix/postfix-script[864]: warning: not owned by postfix: /var/lib/postfix/./master.lock
 
 ---------------------- Postfix End -------------------------
0
 

Author Comment

by:johandrex
ID: 40511625
And when trying to send a email with sendmail
   ----- The following addresses had permanent fatal errors -----
<johannes.seldevall@telia.com>
    (reason: 553 <root@email.minecraftcommunity.org> unable to verify address)

   ----- Transcript of session follows -----
... while talking to mail.telia.com.:
>>> MAIL From:<root@email.minecraftcommunity.org> SIZE=781
<<< 553 <root@email.minecraftcommunity.org> unable to verify address
501 5.6.0 Data format error

--sBL9qUwS029173.1419155550/email.minecraftcommunity.org
Content-Type: message/delivery-status

Reporting-MTA: dns; email.minecraftcommunity.org
Received-From-MTA: DNS; email.minecraftcommunity.org
Arrival-Date: Sun, 21 Dec 2014 10:52:30 +0100

Final-Recipient: RFC822; johannes.seldevall@telia.com
Action: failed
Status: 5.1.3
Diagnostic-Code: SMTP; 553 <root@email.minecraftcommunity.org> unable to verify address
Last-Attempt-Date: Sun, 21 Dec 2014 10:52:30 +0100

--sBL9qUwS029173.1419155550/email.minecraftcommunity.org
Content-Type: message/rfc822

Return-Path: <root@email.minecraftcommunity.org>
Received: from email.minecraftcommunity.org (email.minecraftcommunity.org [127.0.0.1])
	by email.minecraftcommunity.org (8.14.4/8.14.4) with ESMTP id sBL9qUwS029171
	for <johannes.seldevall@telia.com>; Sun, 21 Dec 2014 10:52:30 +0100
Received: (from root@localhost)
	by email.minecraftcommunity.org (8.14.4/8.14.4/Submit) id sBL9qUkN029170
	for johannes.seldevall@telia.com; Sun, 21 Dec 2014 10:52:30 +0100
From: root <root@email.minecraftcommunity.org>
Message-Id: <201412210952.sBL9qUkN029170@email.minecraftcommunity.org>
Date: Sun, 21 Dec 2014 10:52:30 +0100
To: johannes.seldevall@telia.com
Subject: testing mail
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

awd
d.

--sBL9qUwS029173.1419155550/email.minecraftcommunity.org--

Open in new window

0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40511626
I meant your mail.log after trying to send an email.

The postfix error is a permissions issue
Try running
chown postfix.postfix -R /var/lib/postfix

Open in new window


And start postfix
0
 

Author Comment

by:johandrex
ID: 40511628
oh wow it worked haha
0
 

Author Comment

by:johandrex
ID: 40511629
I'll set up the postfix and check if it works now, thanks
0
 
LVL 58

Expert Comment

by:Gary
ID: 40511631
Your email is being rejected by the destination server.

In your PHP script specify a valid from address
0
 
LVL 58

Expert Comment

by:Gary
ID: 40511632
Then you can follow the instructions for the email routing in the previous question and your email shouldn't be rejected then.
0
 

Author Comment

by:johandrex
ID: 40511742
Thank you so much dude! Finally it's working!!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you using email marketing software? If not, you're missing out on effortless marketing and the reaching of desired conversion rates through email marketing software.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This Micro Tutorial will demonstrate the easy use of Gmail embedding images in your email so the recipient of your email can view them in context.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question