I have a basic form on my site with fields like name, email etc. It sends to my email address with theses details normally.
However! I have just got myself a dedicated server with plesk on it.
I have pointed my name servers to my new dedicated server, and have got the site on there live. I have also recreated the email addresses with mailboxes, which all work.
BUT my site now does not want to send emails.
I have tested it again with this basic code without any luck.
<?php
$Name = "Da Duder"; //senders name
$email = "[email protected]"; //senders e-mail adress
$recipient = "[email protected]"; //recipient
$mail_body = "The text for ddfthe mail..."; //mail body
$subject = "Subjectdfdfd"; //subject
$header = "From: ". $Name . " <" . $email . ">rn"; //optional headerfields
mail($recipient, $subject, $mail_body, $header); //mail command :)
?>
I have been reading around about modifying the php.ini file to allow anonymous sending or something which is beyond my knowledge of PHP.
Is there anything i can check?
2
Answers
try finding out your email settings, perhaps you don’t have a correct servers settings. phpinfo() is a good way to start looking
Have you set-up the dedicated server yourself?
Do you have
error_reporting(E_ALL ^ E_NOTICE)
andini_set('display_errors', 'On')
for testing?Did you check your junk-mail folder?
Are you sure PHP is not throwing an error? Try this to make sure:
Otherwise ask a system or network adminstrator 🙂