Smart questions
Smart answers
Smart people
Join Tek-Tips Forums

Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

mail() function - "sendmail_from" not set in php.iniHelpful Member! 

way2many (TechnicalUser) (OP)
7 Jul 05 18:48
I need to use mail() function on several PHP pages.
(we are renting web space on win2000 server and have access through H-Sphere control panel)


Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing

I put a copy of php.ini in the root of my website as someone from tech support suggested some time ago.

here is what it looks like in php.ini after my changes:
[mail function]
; For Win32 only.
SMTP = ; for Win32 only
;smtp_port = 25
sendmail_from= ; for Win32 only
still getting the same error...

Is php.ini in the wrong place or something else is not correct?

thank you
test file w/php mail function:


$email = ""; # email address of recipient
$subject = "This is a test email"; # subject of email
$body = "This is where the text goes...";
$mail_hrd = "From: &lt;;";


Helpful Member!  WoodyRoundUp (Programmer)
7 Jul 05 19:13
I think it's because you are sharing the server, and your php.ini is not read by PHP.

You can try this:
ini_set ("SMTP","");
ini_set ("sendmail_from","");

put them on top of your page, in the PHP tag. See whether it makes any different.
way2many (TechnicalUser) (OP)
7 Jul 05 19:30

You just got a STAR!
It works!

Many thanks!
WoodyRoundUp (Programmer)
7 Jul 05 19:36

My first day here as a solution provider, I got a star.

UrbanIntensity (TechnicalUser)
25 Jul 05 1:27
Question:  I am running a mb that works off phpbb.  I am having a similar problem. sendmail_from has no calue and the sendmail_path is showing the default. I know how to fix the issue but, unfortunately, my server host doesn't give me access to my php.ini file.

Would this workaround work in this situation? If so, where do I need to place it?
WoodyRoundUp (Programmer)
25 Jul 05 1:33
Place this on top of your page.

ini_set ("SMTP","");
ini_set ("sendmail_from","");

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close