php email script sends to 1 kind of emails but not to other

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saar62097
Forum Newbie
Posts: 3
Joined: Thu Jul 19, 2012 7:10 am

php email script sends to 1 kind of emails but not to other

Post by saar62097 »

hello all

I have a little php script on my server for sending mail:

Code: Select all

<?
$to=$_POST["to"];
$subject=$_POST["subject"];
$body=$_POST["body"];
mail($to,$subject,$body);
?>
when I pass this kind of email - myEmail@gmail.com all is fine but when I pass this kind of mail - mail@myWebSite.com the mail won't send. any ideas why?

also, i am not sure my server has mail turned on - does that matter?

thanx in advance
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: php email script sends to 1 kind of emails but not to ot

Post by requinix »

Your mail server probably doesn't allow you to send from an @myWebSite.com address. Ask whoever maintains it to let you do so.
Post Reply