regdude Posted March 12, 2009 Share Posted March 12, 2009 Hi! I'm using PHP6 and I'm having problems with sending a mail. <?php $Name = "Da Duder"; //senders name $email = "email@adress.com"; //senders e-mail adress $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient $mail_body = "The text for the mail..."; //mail body $subject = "Subject for reviever"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command ?> This is a simple example and it doesn't work on my windows xp :/ (mail just doesn't come) Why is that? Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 12, 2009 Share Posted March 12, 2009 Add the following two lines immediately after your opening <?php tag - ini_set ("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-783097 Share on other sites More sharing options...
regdude Posted March 12, 2009 Author Share Posted March 12, 2009 I don't think here is a php error. Anyway, with error repoting there are no errors still. I haven't did anything to php.ini! Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-783118 Share on other sites More sharing options...
corbin Posted March 12, 2009 Share Posted March 12, 2009 Do you have a mail server? Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-783256 Share on other sites More sharing options...
regdude Posted March 13, 2009 Author Share Posted March 13, 2009 No. Thats why I said I haven't did anything to php.ini As I read an article then PHP uses a builtin server. I also have a linux server that has sendmail. Also there I didn't do anything to php.ini, but the mail seems to be sent from phpbb forum (sometimes), but not from the example script. Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-783831 Share on other sites More sharing options...
trq Posted March 16, 2009 Share Posted March 16, 2009 As I read an article then PHP uses a builtin server. There is no mail server built into php, its a programming language. You will need to install and configure a mailserver. Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-785583 Share on other sites More sharing options...
regdude Posted March 17, 2009 Author Share Posted March 17, 2009 Can you recommend one for simply this purpose? Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-786809 Share on other sites More sharing options...
trq Posted March 17, 2009 Share Posted March 17, 2009 Sorry, Im not a windows user. Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-786821 Share on other sites More sharing options...
regdude Posted March 17, 2009 Author Share Posted March 17, 2009 You're a linux user? Also that can do Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-786823 Share on other sites More sharing options...
trq Posted March 17, 2009 Share Posted March 17, 2009 I use ssmtp to send mail through google's servers on Linux. Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-786829 Share on other sites More sharing options...
corbin Posted March 17, 2009 Share Posted March 17, 2009 hMailServer under Windows has always worked fine for me, but I don't exactly send emails often. Quote Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-787130 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.