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 protected]"; //senders e-mail adress $recipient = "[email protected]"; //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? 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); 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! 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? 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. 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. 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? 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. 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 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. 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. Link to comment https://forums.phpfreaks.com/topic/149105-mail-from-win32/#findComment-787130 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.