Jump to content

email didn't work


gongpex

Recommended Posts

Hello everyone, Before I post this thread I want to say "Merry Christmas" for anyone who celebrate. Today I tried to create email to send other email using this code :

<?php$to = "myemail@gmail.com";$subject = "Test mail";$message = "Hello! This is a simple email message.";$from = "someonelse@example.com";$headers = "From:" . $from;mail($to,$subject,$message,$headers);echo "Mail Sent.";?>

But when I open my email, it won't sent anything, Q : Actually what requirement to create email, so that at least it can be send message to other email? please someone answer me Thanks

Link to comment
Share on other sites

if you are trying this from localhost server you must have to do some setting like add port for SMTP and all.. but if u use this on live it will work without any settings..
I had try this before on live, not at localhost, but this won't work, I use free domain hosting, and the hosting support it. please tell me if there is some setting thanks
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...