By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,350 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,350 IT Pros & Developers. It's quick & easy.

PHP mail () function configuration

P: n/a
hi every body,

i have a problem which is when i was checking my mail() form it work
fine but the problem is that the form configuration is not set
correctly, in details:
the from var is not working and the from is set to be my host provider
email is the sender, so they told me to configure the php.ini file and
i dont know what is this file and how to configure it.

thanks in advance

shror
www.s7els7.com
www.beachtoursegypt.com
www.mobidp.com

Feb 22 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Feb 22, 2:32 am, "shror" <shahi...@gmail.comwrote:
hi every body,

i have a problem which is when i was checking my mail() form it work
fine but the problem is that the form configuration is not set
correctly, in details:
the from var is not working and the from is set to be my host provider
email is the sender, so they told me to configure the php.ini file and
i dont know what is this file and how to configure it.

thanks in advance

shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobi dp.com
The php.ini file is your php configuration file, if you are on windows
it should be in you c:\windows directory, if you are on linux it
should be on you /etc directory (I could be wrong on this, haven't
configured php on linux in awhile), not sure where it would go in Mac
OS X

Feb 22 '07 #2

P: n/a
On 22 Feb, 10:32, "shror" <shahi...@gmail.comwrote:
hi every body,

i have a problem which is when i was checking my mail() form it work
fine but the problem is that the form configuration is not set
correctly, in details:
the from var is not working and the from is set to be my host provider
email is the sender, so they told me to configure the php.ini file and
i dont know what is this file and how to configure it.

thanks in advance

shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobi dp.com
We are very helpful on these groups, but you do have to help us to
help you!
i have a problem which is when i was checking my mail() form
mail() is a function, not a form. Please state precisely what you
have a problem with.
it work fine
if it works fine then there is no problem but then...

the problem is that the form configuration is not set correctly,
If it works fine there is no problem!
How do you know is is the configuration?
the from var is not working
The from var? What from var? When using teh mail() function the From
address can be specified in the call.

Feb 22 '07 #3

P: n/a
On Feb 22, 2:52 pm, "Captain Paralytic" <paul_laut...@yahoo.com>
wrote:
On 22 Feb, 10:32, "shror" <shahi...@gmail.comwrote:
hi every body,
i have a problem which is when i was checking my mail() form it work
fine but the problem is that the form configuration is not set
correctly, in details:
the from var is not working and the from is set to be my host provider
email is the sender, so they told me to configure the php.ini file and
i dont know what is this file and how to configure it.
thanks in advance
shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobi dp.com

We are very helpful on these groups, but you do have to help us to
help you!i have a problem which is when i was checking my mail() form

mail() is a function, not a form. Please state precisely what you
have a problem with.
it work fine

if it works fine then there is no problem but then...
the problem is that the form configuration is not set correctly,

If it works fine there is no problem!
How do you know is is the configuration?
the from var is not working

The from var? What from var? When using teh mail() function the From
address can be specified in the call.
my first question:

my problem is not with the mail() function it self but with the From
address inside the mail(), so that i set the function like this:
mail($to,$subject,$message,$from,$headder) and its working every item
go to its place except the $from i set the $from to be for example:
fo**@s7els7.com, but what comes to me is: my-host-provider@his-
domain.com, could you please tell me how to fix this problem, as i
going to put another tell friend box on my website.

my host is on windows server
1- what settings to put in the php.ini file or in my form
2- how i can set my X-mailer what is the correct syntax
3- how i can set my form to send me the ip,date,time of the visitor
submitting my form, is it possible to get these values

----------------------------------------------------------------------

my second question:

how i can put number of visitors now online on my pages.

is this possible using the php

thanks in advance
and am sorry if my question are not clear, but am still beginner in
the php just from couple of weeks, & am very eager to learn it in a
professional way.
shror
www.s7els7.com
www.beachtoursegypt.com
www.mobidp.com

Feb 22 '07 #4

P: n/a
On 22 Feb, 14:28, "shror" <shahi...@gmail.comwrote:
On Feb 22, 2:52 pm, "Captain Paralytic" <paul_laut...@yahoo.com>
wrote:


On 22 Feb, 10:32, "shror" <shahi...@gmail.comwrote:
hi every body,
i have a problem which is when i was checking my mail() form it work
fine but the problem is that the form configuration is not set
correctly, in details:
the from var is not working and the from is set to be my host provider
email is the sender, so they told me to configure the php.ini file and
i dont know what is this file and how to configure it.
thanks in advance
shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobi dp.com
We are very helpful on these groups, but you do have to help us to
help you!i have a problem which is when i was checking my mail() form
mail() is a function, not a form. Please state precisely what you
have a problem with.
it work fine
if it works fine then there is no problem but then...
the problem is that the form configuration is not set correctly,
If it works fine there is no problem!
How do you know is is the configuration?
the from var is not working
The from var? What from var? When using teh mail() function the From
address can be specified in the call.

my first question:

my problem is not with the mail() function it self but with the From
address inside the mail(), so that i set the function like this:
mail($to,$subject,$message,$from,$headder) and its working every item
Erm, isn't that the same thing really (results wise)!

Anyway according to the manual:
bool mail ( string $to, string $subject, string $message [, string
$additional_headers [, string $additional_parameters]] )

I do not see a "from" parameter there???

go to its place except the $from i set the $from to be for example:
f...@s7els7.com, but what comes to me is: my-host-provider@his-
domain.com, could you please tell me how to fix this problem, as i
going to put another tell friend box on my website.

my host is on windows server
1- what settings to put in the php.ini file or in my form
2- how i can set my X-mailer what is the correct syntax
3- how i can set my form to send me the ip,date,time of the visitor
submitting my form, is it possible to get these values

----------------------------------------------------------------------

my second question:

how i can put number of visitors now online on my pages.

is this possible using the php

thanks in advance
and am sorry if my question are not clear, but am still beginner in
the php just from couple of weeks, & am very eager to learn it in a
professional way.

shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobi dp.com- Hide quoted text -

- Show quoted text -

Feb 22 '07 #5

P: n/a
On Feb 22, 4:44 pm, "Captain Paralytic" <paul_laut...@yahoo.com>
wrote:
On 22 Feb, 14:28, "shror" <shahi...@gmail.comwrote:
On Feb 22, 2:52 pm, "Captain Paralytic" <paul_laut...@yahoo.com>
wrote:
On 22 Feb, 10:32, "shror" <shahi...@gmail.comwrote:
hi every body,
i have a problem which is when i was checking my mail() form it work
fine but the problem is that the form configuration is not set
correctly, in details:
the from var is not working and the from is set to be my host provider
email is the sender, so they told me to configure the php.ini file and
i dont know what is this file and how to configure it.
thanks in advance
shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobi dp.com
We are very helpful on these groups, but you do have to help us to
help you!i have a problem which is when i was checking my mail() form
mail() is a function, not a form. Please state precisely what you
have a problem with.
it work fine
if it works fine then there is no problem but then...
the problem is that the form configuration is not set correctly,
If it works fine there is no problem!
How do you know is is the configuration?
the from var is not working
The from var? What from var? When using teh mail() function the From
address can be specified in the call.
my first question:
my problem is not with the mail() function it self but with the From
address inside the mail(), so that i set the function like this:
mail($to,$subject,$message,$from,$headder) and its working every item

Erm, isn't that the same thing really (results wise)!

Anyway according to the manual:
bool mail ( string $to, string $subject, string $message [, string
$additional_headers [, string $additional_parameters]] )

I do not see a "from" parameter there???
go to its place except the $from i set the $from to be for example:
f...@s7els7.com, but what comes to me is: my-host-provider@his-
domain.com, could you please tell me how to fix this problem, as i
going to put another tell friend box on my website.
my host is on windows server
1- what settings to put in the php.ini file or in my form
2- how i can set my X-mailer what is the correct syntax
3- how i can set my form to send me the ip,date,time of the visitor
submitting my form, is it possible to get these values
----------------------------------------------------------------------
my second question:
how i can put number of visitors now online on my pages.
is this possible using the php
thanks in advance
and am sorry if my question are not clear, but am still beginner in
the php just from couple of weeks, & am very eager to learn it in a
professional way.
shrorwww.s7els7.comwww.beachtoursegypt.comwww.mobi dp.com-Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
its written that the $additional_heders is the var that contain the
From, CC, Bcc stuff
and i did added to it these stuff but its not working

Feb 22 '07 #6

P: n/a
On 22 Feb, 15:22, "shror" <shahi...@gmail.comwrote:
its written that the $additional_heders is the var that contain the
From, CC, Bcc stuff
and i did added to it these stuff but its not working
True it is, but your code shows you supplying a $headder (SIC)
variable in addition to a $from variable which certainly doesn't fit
with the spec.
Care to share precisely what you are putting in each of these
variables?

Feb 22 '07 #7

P: n/a
On Feb 22, 5:34 pm, "Captain Paralytic" <paul_laut...@yahoo.com>
wrote:
On 22 Feb, 15:22, "shror" <shahi...@gmail.comwrote:
its written that the $additional_heders is the var that contain the
From, CC, Bcc stuff
and i did added to it these stuff but its not working

True it is, but your code shows you supplying a $headder (SIC)
variable in addition to a $from variable which certainly doesn't fit
with the spec.
Care to share precisely what you are putting in each of these
variables?
Thank you so much, i got it.

but i have another problem other than this but its related to my forms
too :D
really am so sorry for being a source of headache.

its that i want to put an array so that when the form is submitted the
script Checks for the username added if its already in the array or
not,
if not in the array the mail is sent,
and if found in the array error message is echoed and mail() function
is neglected.

my first trial:

$name = array("first","second","third");
if ($user == $name)
echo "The username found please choose another one!";
else {
mail($to,$subject,$message,$from);
echo "Thank you";
}

this output is that the mail function is sent any way even if the
username is in the array

my second trial:

$name = array("first","second","third");
if ($user = $name)
echo "The username found please choose another one!";
else {
mail($to,$subject,$message,$from);
echo "Thank you";
}

in the if statement i used one = sign not == and it gives me the error
message even if the name is not in this array.

can you please tell me how i can solve this situation

Thanks anyway for your help Captain Paralytic

Feb 22 '07 #8

P: n/a
Message-ID: <11**********************@v45g2000cwv.googlegroups .comfrom
shror contained the following:
>$name = array("first","second","third");
if ($user = $name)
if (in_array ( $user ,$name){
....
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Feb 22 '07 #9

P: n/a
On Feb 22, 8:06 pm, Geoff Berrow <blthe...@ckdog.co.ukwrote:
Message-ID: <11**********************@v45g2000cwv.googlegroups .comfrom
shror contained the following:
$name = array("first","second","third");
if ($user = $name)

if (in_array ( $user ,$name){
...
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDshttp://www.ckdog.co.uk/rfdmaker/
Thanks so so so soooooooooo much i really dont know how to thank you
its working fine

Feb 22 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.