Mil1243 Posted July 26, 2007 Share Posted July 26, 2007 hi everyone, I used the following code to send mail, but nothing happened. <?php function maile(){ $mail_date = date('l dS \of F Y h:i:s A'); $email_url = $_SERVER['PHP_SELF']; $email_ip = $_SERVER['REMOTE_ADDR']; $to = 'someone@gmail.com'; $subject2 = "PHP sender"; $email = "The following page, $email_url , was accessed. IP: $email_ip Date: $mail_date This is an automated email! DO NOT REPLY!"; $from = "someone@yahoo.co.uk"; $headers1 = "MIME-Version: 1.0\r\n"; $headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers1 .= "To: ".$to."\r\n"; $headers1 .= "From: ".$from."\r\n"; $headers1 .= "Reply-To: ".$from."\r\n"; mail($to, $subject2, $email, $headers1); } maile(); ?> i tried it on my localhost(IIS) and even in a free host (www.5gbfree.com). in my localhost it generated a warning: Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for someone@gmail.com in f:\inetpub\wwwroot\l.php on line 27 I read in PHP Manual that the mail function need to have access to sendmail binary or other mail programs like qmail or postfix. what are them? should i need to install a program? Please help me !!! Quote Link to comment 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.