...

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



Code Wizard
01-25-2004, 02: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??

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

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

Thx.

Nightfire
01-25-2004, 02: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, 02: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...?

sitami
01-25-2004, 11:28 PM
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, 04:45 PM
Thanks,it does,but can't I leave the sendmail_from commented out and specify it in the mail()'s "From:" argument...??

sitami
01-26-2004, 05: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, 08:26 PM
Yup,works.
Thx alot dude!
:thumbsup:

sitami
01-26-2004, 11:19 PM
no problem :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum