max_w1 Posted October 1, 2008 Share Posted October 1, 2008 hi i want to my feed back form to send all information to be sent on my mail. but it is not working. i tried using many scripts but no use, i have a simple script for testing but that is not working too. could someone plz tell me how to do it. the script which i used for testing is: <?php $to = "masood_w1@yahoo.co.in"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/126606-problem-in-mail-function/ Share on other sites More sharing options...
Maq Posted October 1, 2008 Share Posted October 1, 2008 Are there any errors? What is the output? Please look at this: PHP: Mail. I think you need to have headers. Do you have mail set up on your server? Quote Link to comment https://forums.phpfreaks.com/topic/126606-problem-in-mail-function/#findComment-654669 Share on other sites More sharing options...
max_w1 Posted October 1, 2008 Author Share Posted October 1, 2008 hi, i have mail server, and i have also set headers have a look at this code: <?php $Name = "Da Duder"; //senders name $email = "masoodw1@gmail.com"; //senders e-mail adress $recipient = "websoft_w1@yahoo.com"; //recipient $mail_body = "The text for the mail..."; //mail body $subject = "Subject for reviever"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields ini_set('websoft_w1@yahoo.com', 'masoodw1@gmail.com'); mail($recipient, $subject, $mail_body, $header); //mail command ?> it is still not working.. please help me. pleeeeeeeeese. Quote Link to comment https://forums.phpfreaks.com/topic/126606-problem-in-mail-function/#findComment-654675 Share on other sites More sharing options...
kenrbnsn Posted October 1, 2008 Share Posted October 1, 2008 What do you mean by "it's not working"? DO you get errors? Is the mail not received? Have you checked you spam folder on YAHOO? Some ISP's/Hosts will not let you send an email message unless the "from" address is actually from the same domain. Ken Quote Link to comment https://forums.phpfreaks.com/topic/126606-problem-in-mail-function/#findComment-654835 Share on other sites More sharing options...
max_w1 Posted October 8, 2008 Author Share Posted October 8, 2008 can anyone tell me where i can find free webhosting with php mail() support? Quote Link to comment https://forums.phpfreaks.com/topic/126606-problem-in-mail-function/#findComment-659732 Share on other sites More sharing options...
Maq Posted October 8, 2008 Share Posted October 8, 2008 Try Google, why can't you use your mail server? Quote Link to comment https://forums.phpfreaks.com/topic/126606-problem-in-mail-function/#findComment-660094 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.