Hi am kinda stuck here, so please if anyone could help me,i have 2 domains working on same hosting, one is Main Domain and other Addon, am using mail() function in Addon Dowmain website. everything is working fine, problem is script is running on addon domain but when people get mails, it shows other domain's name i.e. maindomain's so please if anyone can tell me how i can change this thing that when people get mail it shows From:Addon domain.
and i donot have ini.php file or whatever it is, because both of my websites are running over hosting company's server.
Thanx in advance

have just found the solution use of header will do that, but getting an another problem, P.S. as anybody get mail it shows up like this as mail sent from daniweb
from DaniWeb IT Discussion Community
<community@daniwebmail.com>
i used

$headers = 'From: Anything <admin@XYZ.com>' . "\r\n";

problem is am getting mails by :
from admin
<admin@xyz.com>
is there anyone who can tell how can i write my own stuff instead of "DaniWeb IT Discussion Community" or "admin".

You can add headers as a 4th parameter of the mail function.
Try "From:xyz@maindomain.com\r\n\Reply-to:xyz@maindomain.com"

it worked, thanx, now problem am getting is it is showing up like this
from admin <admin@xyz.com> how can i customize "admin" to ANYTHING or ANYNAME i would like? so it would show up like from ANYTHING <admin@xyz.com>

as daniwebs' mails show like
from DaniWeb IT Discussion Community <community@daniwebmail.com>

i want to customize "DaniWeb IT Discussion Community " this field. how i made myself clear.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.