MAIL()ERROR

the mail() function

Moderators: macek, egami, gesf

wenny_shu
New php-forum User
New php-forum User
Posts: 8
Joined: Fri Mar 04, 2005 11:28 am

MAIL()ERROR

Postby wenny_shu » Sat Apr 02, 2005 1:51 pm

HI guys,

I did change smtp and add header, but still error comes out.
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = whatever@yahoo.ca



<?php
$to = $_POST['S_EMAIL'];
$from = "whatever@yahoo.com";
$title = "your password";
#setting a header
$header = "From: me <whatever@yahoo.com>\r\n";
$body = " This email reminds you the password . Please direct all requests to whatever@yahoo.com. Thank you.";
#now sending
mail($to,$title,$body,$header);
?>

error:

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\web\adm_email.php on line 9
Email has been sent!



:help: :help: :help:

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Postby ruturajv » Sun Apr 03, 2005 8:28 pm

check this from the documentation

Code: Select all

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" .
   'Reply-To: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" .
   'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>


and please read this mail


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron