View Full Version : mail() function not working...

Code Wizard
01-25-2004, 03:11 PM
mail("$mailto", "the subject", $message,"Wrom: CUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJV

The error I get is:
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing.

Why is this...? And what should I do??

01-25-2004, 03:32 PM
mail("$mailto", "the subject", $message,"From: Email name <email@address.com>");

Code Wizard
01-25-2004, 03:39 PM
Can't is use a variable in the Wrom: IPBARHDMNNSKVF
Also is it completely necessary to enclose vars in double quotes("..."),coz they anyway get expanded,can't I just use:


01-25-2004, 03:43 PM
No, don't need to use double quotes and you can use variables. I was just pointing out what was wrong

Code Wizard
01-25-2004, 03:46 PM
Yes,I see...but the probem persists...I still get the same error message,should I look at php.ini for a possible solution...?

01-26-2004, 12:28 AM
have you edited the pp.ini file and changed the SMTP settings ?

open php.ini with notepad .. search for SMTP

set your hostname ( usually mail.yourdomain.com )
& email address

& if you are using linux / uinx etc etc you must define the path
to your sendmail daemon

im using a windows based ( local ) webserver but my email is handled via a linux box so i have the following

[mail function]
; For Win32 only.
SMTP = mail.mydomain.com
; For Win32 only.
sendmail_from = chris@mydomain.com
; For Unix only. You may supply arguments as well (default: 'sendmail -t -i').
;sendmail_path = /etc/local/sendmail

hope that helps :)

Code Wizard
01-26-2004, 05:45 PM
Thanks,it does,but can't I leave the sendmail_from commented out and specify it in the mail()'s "From:" argument...??

01-26-2004, 06:04 PM
i think so .. give it a try .. havent tried it myself.

as long as you specify $from in your script it should work but no promising

good luck :)

Code Wizard
01-26-2004, 09:26 PM
Thx alot dude!

01-27-2004, 12:19 AM
no problem :)