#1  
Old 15th January 2013, 16:38
ohdude ohdude is offline
Junior Member
 
Join Date: Jan 2013
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Cannot Send mail & Piwik error

Hi everyone,

I've got a little problem, First of all I cannot send any mails, using the PHP mail function. Using this code

<?php
$datum = date("j/n/Y");
mysql_connect("127.0.0.1", "*****", "*****")or die(mysql_error());
mysql_select_db("c0Controleonline") or die(mysql_error());
$resultuser = mysql_query( "select * from Gebruikers, Meldingen, Plaatsen where Gebruikers.MijnPro = Plaatsen.Provincie and Meldingen.Plaats = Plaatsen.PlaatsID and Gebruikers.Activated = '1' and Meldingen.Sended = '1' and datum = '$datum' ");
if ($resultuser !== false) {
include 'config.php';
while($row=mysql_fetch_array($resultuser)){
$message = "Beste ".$row['Username'].",<br />
Wij hebben weer een melding door gekregen.<br />
Plaats: ".$row['Plaatsnaam']."
<br />Provincie: ".$row['Provincie']."
<br />Datum:".$row['Datum']."
<br />Tijd:".$row['Tijd']."<br />
Ter hoogte van: ".$row['thv']."<br />Melding: <img src=$websiteurl/images/Meld/".$row['soort'] .".jpg /><br /><br />Je krijgt deze meldingen omdat je je aangemeld hebt op $websitetitle. <br /> Wil je dit opzeggen dan kun je dit instellen in je account <br />
<br />
<p><strong>Met vriendelijke groeten,</strong></p>
<p><strong>Het $websitetitle team</strong></p><br />
<br />
$websiteurl";
$subject = "Meldingen";

// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'From: Controle-online melder <automailer@controle-online.nl>' . "\r\n";
mail($row['Email'], $subject, $message,$headers);



}
mysql_query("UPDATE Meldingen,Gebruikers,Plaatsen SET Meldingen.Sended='0'
WHERE Gebruikers.MijnPro = Plaatsen.Provincie and Meldingen.Plaats = Plaatsen.PlaatsID and Meldingen.Sended = '1'")or die(mysql_error());
}
else {
echo mysql_error();
}
?>

Database updated but no mail send ,
I cannot connect via example thunderbird


I also cannot reach the twitter API and post on twitter well Itested on another server (my synology server)


Greets,


Daan

PS. Its running on a VPS from https://www.budgetvm.com (openvz)
Reply With Quote
Sponsored Links
  #2  
Old 16th January 2013, 18:10
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Are there any errors in your mail log (in the /var/log/ directory)?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 16th January 2013, 20:57
ohdude ohdude is offline
Junior Member
 
Join Date: Jan 2013
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mail.warn

PHP Code:
Jan 15 04:45:33 server1 sm-mta[773]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:45:35 server1 sm-msp-queue[778]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:46:33 server1 sm-mta[773]: unable to qualify my own domain name (server1) -- using short name
Jan 15 04
:46:33 server1 sm-mta[773]: gethostbyaddr(127.0.0.2failed1
Jan 15 04
:46:35 server1 sm-msp-queue[778]: unable to qualify my own domain name (server1) -- using short name
Jan 15 04
:46:50 server1 sm-mta[773]: gethostbyaddr(199.231.215.201failed2
Jan 15 04
:46:51 server1 sm-mta[773]: gethostbyaddr(198.98.102.222failed1
Jan 15 04
:48:32 server1 sm-mta[648]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:48:34 server1 sm-msp-queue[653]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:49:32 server1 sm-mta[648]: unable to qualify my own domain name (server1) -- using short name
Jan 15 04
:49:32 server1 sm-mta[648]: gethostbyaddr(127.0.0.2failed1
Jan 15 04
:49:34 server1 sm-msp-queue[653]: unable to qualify my own domain name (server1) -- using short name
Jan 15 04
:49:49 server1 sm-mta[648]: gethostbyaddr(199.231.215.201failed2
Jan 15 04
:49:50 server1 sm-mta[648]: gethostbyaddr(198.98.102.222failed1
Jan 15 05
:02:21 server1 postfix/master[4896]: fatalbind 0.0.0.0 port 25Address already in use
Jan 15 05:59:35 server1 postfix/master[29338]: fatalbind 0.0.0.0 port 25Address already in use
Jan 15 06:00:11 server1 postfix/postqueue[30408]: warningMail system is down -- accessing queue directly 
Mail.err

PHP Code:
Jan 15 04:45:33 server1 sm-mta[773]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:45:35 server1 sm-msp-queue[778]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:46:33 server1 sm-mta[773]: unable to qualify my own domain name (server1) -- using short name
Jan 15 04
:46:35 server1 sm-msp-queue[778]: unable to qualify my own domain name (server1) -- using short name
Jan 15 04
:48:32 server1 sm-mta[648]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:48:34 server1 sm-msp-queue[653]: My unqualified host name (server1unknownsleeping for retry
Jan 15 04
:49:32 server1 sm-mta[648]: unable to qualify my own domain name (server1) -- using short name
Jan 15 04
:49:34 server1 sm-msp-queue[653]: unable to qualify my own domain name (server1) -- using short name
Jan 15 05
:02:21 server1 postfix/master[4896]: fatalbind 0.0.0.0 port 25Address already in use
Jan 15 05:59:35 server1 postfix/master[29338]: fatalbind 0.0.0.0 port 25Address already in use 
Reply With Quote
  #4  
Old 18th January 2013, 12:10
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Looks like something else is occupying port 25. What's the output of
Code:
netstat -tap
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 18th January 2013, 12:22
ohdude ohdude is offline
Junior Member
 
Join Date: Jan 2013
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

netstat -tap

PHP Code:
tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN      
1945
/apache2                                                                    
tcp6       0      0 
[::]:http               [::]:*                  LISTEN      
1945
/apache2                                                                    
tcp6       0      0 
[::]:tproxy             [::]:*                  LISTEN      
1945
/apache2                                                                    
tcp6       0      0 
[::]:ftp                [::]:*                  LISTEN      
1305
/pure-ftpd (SER                                                             
tcp6       0      0 
[::]:domain             [::]:*                  LISTEN      
542
/named                                                                       
tcp6       0      0 
[::]:ssh                [::]:*                  LISTEN      
384
/sshd                                                                        
tcp6       0      0 
[::]:smtp               [::]:*                  LISTEN      
1293
/master                                                                     
tcp6       0      0 localhost
:953           [::]:*                  LISTEN      
542
/named                                                                       
tcp6       0      0 
[::]:https              [::]:*                  LISTEN      
1945
/apache2                                                                    
tcp6       0      0 
[::]:imaps              [::]:*                  LISTEN      
447
/dovecot                                                                     
tcp6       0      0 
[::]:pop3s              [::]:*                  LISTEN      
447
/dovecot                                                                     
root
@server1:~# ^C                                                              
root@server1:~# ^C                                                              
root@server1:~
this
Reply With Quote
  #6  
Old 21st January 2013, 20:23
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Looks ok. Have you tried to reboot the system?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 21st January 2013, 20:25
ohdude ohdude is offline
Junior Member
 
Join Date: Jan 2013
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

about 10 times
Reply With Quote
  #8  
Old 22nd January 2013, 22:02
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
 
Default

Is it possible you have Sendmail and Postfix installed at the same time? If so, please remove sendmail.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR: Connection dropped by IMAP server. [Centos 5.4, courier imap,squirrel, etc] darevil HOWTO-Related Questions 7 9th June 2010 15:49
cyrus-sasl won't install on my ubuntu9.04 kameelperdza Installation/Configuration 1 13th June 2009 11:28
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 13:16
configuring IPTABLES firewall adityavpratap HOWTO-Related Questions 9 27th May 2006 22:42
Installation Fails... :( cyberstorm Installation/Configuration 1 15th January 2006 19:07


All times are GMT +2. The time now is 12:10.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.