• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Cant mail() with php!

O

Olof Gustafsson

Guest
Hi there.

I just bought a VPS server here in Sweden. I also got Plesk 8.6.0 for administration. I have uploaded a file called "email.php", which is just a regular php email script.

I simply go to the scripts location and it says that the email is sent. But no email is sent...



My code:
<?php
putenv ("QMAILUSER=USER");
putenv ("QMAILNAME=FULL_USER_NAME");
putenv ("QMAILHOST=DOMAIN");
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain;charset=us-ascii\r\n";
$headers .= "From: FULL_USER_NAME <USER@DOMAIN>";
$to="[email protected]";
$subject = "Testing email";
$body = "";
$err = mail($to, $subject, $body, $headers);

if($err) { echo "emailed"; }
else { echo "not emailed"; }
?>



Would really appriceate some help!
 
I'm having the exact same problem. It acts like it sends but nothing goes through. I have checked the symbolic links, added a "From" tag to the php.ini file and still nothing. Did you have any luck?
 
do you get anything about mail delivery attempt in mail log (/usr/local/psa/var/log/maillog) upon script execution?
 
Back
Top