Jump to content

Problem using mail function


Mil1243

Recommended Posts

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 = '[email protected]';
     $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 = "[email protected]";

     $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 [email protected] 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 !!!

Link to comment
https://forums.phpfreaks.com/topic/61873-problem-using-mail-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.