Jump to content

Can't Send Email From Php


Recommended Posts

I'm sure this is a simple one. I cannot get PHP to send email. I get this error:


A message that you sent could not be delivered to one or more of its

recipients. This is a permanent error. The following address(es) failed:



Gid 99 is not permitted to relay mail, or has directly called /usr/sbin/exim instead of /usr/sbin/sendmail.


Here is the PHP script:




$myname = "Dude";

$myemail = "xxx@****";


$contactname = "You";

$contactemail = "xxx@xxx.net";


$subject = "Test msg from php script";


$message .= "Test message\n";


$headers = "From: $myname <$myemail>\r\n";

$headers .= "Reply-To: $myname <$myemail>\r\n";

//$headers .= "To: $contactname <$contactemail>\r\n";

$headers .= "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "X-Priority: 1\r\n";

$headers .= "X-MSMail-Priority: High\r\n";

$headers .= "X-Mailer: PHP test Mailer\n";


mail($contactemail, $subject, $message, $headers,"-xxx@xxxxx.com");




What am I doing wrong?





Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...