Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-28, 22:27:22

Author Topic: Unable to send mail by PHP mail() function  (Read 4063 times)

0 Members and 1 Guest are viewing this topic.

Offline Vikalp_C

  • Junior Member
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Unable to send mail by PHP mail() function
« on: 2017-01-17, 21:47:49 »
Hello, I need help in sending mail by php mail() function, which is used in mail forms in 4 of my websites.
When visitor send a message I never receive them. Qmail is configured properly(I think so)
Here is the sysinfo -
Code: [Select]
[root@server bin]# sh /script/sysinfo

A. Kloxo-MR: 6.5.0.f-2016111301

B. OS: CentOS release 6.8 (Final) x86_64

C. Apps:
   1. MySQL: mysql55-5.5.53-1.ius.el6.x86_64
   2. PHP: php54-5.4.45-1.ius.centos6.x86_64
   3. Httpd: httpd-2.2.31-1.mr.el6.x86_64
   4. Lighttpd: --uninstalled--
   5. Nginx: --uninstalled--
   6. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.20.mr.el6.x86_64
   7. Dns: bind-9.9.7-1.mr.el6.x86_64

D. Php-type (for Httpd/proxy): mod_php_ruid2

E. Memory:
                total       used       free     shared    buffers     cached
   Mem:          4024        486       3537          6          0        239
   -/+ buffers/cache:        246       3777
   Swap:         4060         62       3997


Also checking in /var/logs/maillogs, I see this error -
Code: [Select]
Jan 18 01:35:50 server root: sendmail: CALLER="/usr/sbin/httpd" PWD="/home/trophy/trophy.com" BAN="no"
Jan 18 01:35:50 server send: new msg 110234671
Jan 18 01:35:50 server send: info msg 110234671: bytes 387 from <anonymous@webmail.vikalp.pro> qp 3168 uid 7802
Jan 18 01:35:50 server send: starting delivery 4: msg 110234671 to local laps.in-principal@laps.in
Jan 18 01:35:50 server send: status: local 1/10 remote 0/60
Jan 18 01:35:50 server send: delivery 4: deferral: /bin/sh:_/home/vpopmail/bin/vdelivermail:_Permission_denied/
Jan 18 01:35:50 server send: status: local 0/10 remote 0/60

Any help will be most appreciated.

Many thanks/

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Unable to send mail by PHP mail() function
« Reply #1 on: 2017-01-18, 02:09:52 »
Try 'sh /script/fix-chownchmod; sh /script/fixmail-all'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Vikalp_C

  • Junior Member
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Unable to send mail by PHP mail() function
« Reply #2 on: 2017-01-18, 09:56:10 »
Try 'sh /script/fix-chownchmod; sh /script/fixmail-all'.
Done as instructed. Not getting that previous error this time but mail is not getting delivered either.
Getting this in /var/log/maillogs -

Code: [Select]
Jan 18 14:14:43 server root: sendmail: CALLER="/usr/sbin/httpd" PWD="/home/trophy/trophy.com" BAN="no"
Jan 18 14:14:43 server send: new msg 110235503
Jan 18 14:14:43 server send: info msg 110235503: bytes 385 from <anonymous@webmail.vikalp.pro> qp 19720 uid 7802
Jan 18 14:14:43 server send: starting delivery 3: msg 110235503 to remote vikalp.ch@gmail.com
Jan 18 14:14:43 server send: status: local 0/10 remote 1/60
Jan 18 14:14:44 server send: delivery 3: success: User_and_password_not_set,_continuing_without_authentication./<vikalp.ch@gmail.com>_173.194.64.27_accepted_message.Remote_host_said:_250_2.0.0_OK_1484729520_v25si11131937otf.28_-_gsmtp/
Jan 18 14:14:44 server send: status: local 0/10 remote 0/60
Jan 18 14:14:44 server send: end msg 110235503

But still not receiving the mail.

Also, my domain registrar has provided me 2 free email accounts and unlimited email forwards, I am using my domain registrar control panel to manage, create and forward emails to my gmail account. Have not created any mail accounts inside Kloxo-MR(if this is of any help)

If I send the mail using Gmail or any other account the mail is getting delivered to my domain email (mail@domain.com) and getting forwarded to GMail too successfully. But if someone sends using the contact form in website(mail() function), mail is not delivered. :(

Any setting need to be adjusted inside php.ini or something?

Thanks.
« Last Edit: 2017-01-18, 10:02:10 by Vikalp_C »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Unable to send mail by PHP mail() function
« Reply #3 on: 2017-01-18, 11:08:55 »
In many situation, this issue related to 'wrong' hostname and not enable spf in dns.

Inform here your 'hostname; hostname -s'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Vikalp_C

  • Junior Member
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Unable to send mail by PHP mail() function
« Reply #4 on: 2017-01-18, 12:24:56 »
In many situation, this issue related to 'wrong' hostname and not enable spf in dns.

Inform here your 'hostname; hostname -s'.

Here is the output:
Code: [Select]
hostname: server.vikalp.pro
Code: [Select]
hostname -s: server
I am using DNS templates as provided by my Domain registrars. Don't know where the mail is getting lost.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Unable to send mail by PHP mail() function
« Reply #5 on: 2017-01-18, 14:50:34 »
Check your domain to mxtoolbox.com
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Vikalp_C

  • Junior Member
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Unable to send mail by PHP mail() function
« Reply #6 on: 2017-01-18, 15:17:11 »
Check your domain to mxtoolbox.com

Had 1 error.
Code: [Select]
DMARC record missing
How to obtain the DMARC info and where should I add the DMARC record? In Kloxo-MR DNS template or in the domain registrar control panel?

Thanks.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Unable to send mail by PHP mail() function
« Reply #7 on: 2017-01-18, 16:05:03 »
DMARC setting not exist in Kloxo-MR 6.5.

BTW, did your domain used external mail server (like google apps)?. If yes, you need setting 'Remote mail' for this domain.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Vikalp_C

  • Junior Member
  • *
  • Posts: 31
  • Karma: +0/-0
    • View Profile
Re: Unable to send mail by PHP mail() function
« Reply #8 on: 2017-01-18, 19:51:36 »
DMARC setting not exist in Kloxo-MR 6.5.

BTW, did your domain used external mail server (like google apps)?. If yes, you need setting 'Remote mail' for this domain.

No, I am not using any external mail server. Just using the 2 free email accounts and rest email forwarders provided by my domain registrar.

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine
Click Here

Page created in 0.029 seconds with 19 queries.

web stats analysis