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 = '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 !!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.