mail() problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dannymc1983
Forum Commoner
Posts: 80
Joined: Wed Feb 16, 2005 7:24 am

mail() problem

Post by dannymc1983 »

im trying to send a simple email using the mail() funtion but getting this error message every time:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in c:\wamp\www\Mail\sendmail.php on line 3

i have sendmail_from in php.ini set to my own email address. i only have php set up locally on my pc, would this make a difference.? if not what else could be the problem?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

if you don't have sendmail installed on your machine where php can find it.. it won't likely work..
dannymc1983
Forum Commoner
Posts: 80
Joined: Wed Feb 16, 2005 7:24 am

Post by dannymc1983 »

isnt sendmail part of php?
in php.ini it says only need to specify the path when using unix. im using windows.
any other suggestions?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Yeah it's just the variable in the ini but I think feyd meant if it's not enabled.

Have you set up your smtp server since you're running on localhost unless you are hosting your own SMTP server. You'll need to set it up to the same as the one provided by your ISP otherwise. the bit in the ini that says
SMTP=*****
right near the sendmail_from part.

Also, depending upon the valoume of emails you are intending to send, alot of ISP's block you from sending so many in a set amount of time. Too many people wanting to spam people these days... :roll: :twisted: :( :!:
dannymc1983
Forum Commoner
Posts: 80
Joined: Wed Feb 16, 2005 7:24 am

Post by dannymc1983 »

ok i think it might be because i might not be editing the right file, which sounds a bit stupid i know! i have apahce, php and mysql all installed under wamp. there is a php.ini file in c:\wapm and one in c:\windows. so which one do i edit?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

It should be the one in C:\Windows unless otherwise specified but to diuble check just run

Code: Select all

<?php

phpinfo();

?>
on your local machine and somewhere near the top it tells you the ini file it is using...
Post Reply