fafa0 Posted November 8, 2014 Share Posted November 8, 2014 Hi I have below code : <?php $_SERVER['SERVER_NAME']; $to = "info@domain.com"; $subject = "Test mail"; $body = $_SERVER['SERVER_NAME']; $from = "user@example.com"; $headers = "From:" . $from; mail($to, $subject, $body, $headers) ?> the email is sent correctly but without any body text . I use $_SERVER['SERVER_NAME']; but nothing show as body . I want to use this code load each day becuse I want to know which domain is used my script. but now the code not work. Quote Link to comment https://forums.phpfreaks.com/topic/292365-help-for-sending-email/ Share on other sites More sharing options...
ginerjm Posted November 9, 2014 Share Posted November 9, 2014 Why don't you put a "real" body text in there and see what happens? Quote Link to comment https://forums.phpfreaks.com/topic/292365-help-for-sending-email/#findComment-1496207 Share on other sites More sharing options...
ginerjm Posted November 9, 2014 Share Posted November 9, 2014 Actually if you remove that silly first line that does nothing and add a semi to the last line it works just fine for me. Quote Link to comment https://forums.phpfreaks.com/topic/292365-help-for-sending-email/#findComment-1496208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.