Solved

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

Posted on 2014-12-21
11
244 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
Comment Utility
And what is in your error log?
Do you install Postfix?
0
 

Author Comment

by:johandrex
Comment Utility
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
Comment Utility
Whats in the logs?

When you installed Centos did you not install a GUI like ISPConfig?
0
 

Author Comment

by:johandrex
Comment Utility
--------------------- 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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
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
Comment Utility
oh wow it worked haha
0
 

Author Comment

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

Expert Comment

by:Gary
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you so much dude! Finally it's working!!!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I didn’t use eM Client for long when I decided to swap to Outlook 2016. The reason for the switch is that it started asking for payment to continue some of its services after one month.   The problems I faced when I didn’t pay were:   I was not …
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now