Hi, I've tried EasyPHP and normal PHP configuration and mail function worked well, but now I have XAMMP and my mail function is not working anymore. I've installed the full package of XAMMP succesfully. Error I got after trying to send: We do not relay non-local mail, sorry. Have someone any ideas? I've tried to put my From: -header to the following without luck: me@localhost me@example.com localhost *MYIP* Has someone idea on what is non-local mail? So I can not mail to anywhere else than my own cpu?? thank you
XAMPP doesn't include an SMTP mail server. However, you can configure it to use your ISP mail server: http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html
you can still use SMTP with XAMPP (atleast i do) you can use phpmailer , its free and supports SMTP here is a function by me , so its gona be easier , i use it for my websites function mailuser($mailsubject,$mailbody,$receiveremail,$replyto) { include("phpmailer/class.phpmailer.php"); // include phpmailer class! you may use different folder... //simple stupid function by tenev aka penihop $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "mail.example.com"; // specify main and backup server $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "ex@example.com"; // SMTP username $mail->Password = "examplepassword"; // SMTP password $mail->From = "ex@example.com"; //do NOT fake header. $mail->FromName = $replyto; // from which email adress $mail->AddAddress($receiveremail); // to which email address $mail->AddReplyTo($replyto, "Please do not reply to this email!"); //optional, spcify to which email they will reply $mail->Subject = $mailsubject; $mail->Body = $mailbody; $retcode=false; if(!$mail->Send()) { echo $mail->ErrorInfo; // showerror $retcode=$mail->ErrorInfo; } else { //echo "email was sent"; // show success $retcode=true; } return $retcode; // will return true if email was send } PHP: and here is how you are going to use it : $mailbody=" Hello, bla bla bla b la. so blablalba (xD) bla bloa... bla bla bla blablalbal lalaallalal blabblalbla Thanks, the support. "; // email content $receiveremail="example@hotmail.com"; // to who $replymail="ex@example.com"; // user reply to this email $subject="we are emailng you because ?"; // why we are emailing him :@? if(mailuser($subject,$mailbody,$receiveremail,$replymail)) { echo("Email was send!"); } PHP: don't forget to download phpmailer from here http://phpmailer.worxware.com/ works Perfectly with XAMPP and PHP 4/5/6