////// sending mail
print (mailSender("test@test.com"));
/////////// mail sending function
function mailSender($strMailTo){
$strSubject="Wellcome to Shop Spot";
$strBody="This a Welcome Mail.....Your request is in process...When the site administrator aprove you..You will get an email.. ";
$strMailFrom="saadi_shah@hotmail.com";
return mail($strMailTo,$strSubject,$strBody,$strMailFrom);
}
///// ended
...now come to the problem this code sends mail from an address "nobody@myserver.com".....
but i wanna send this mail from "info@myserver.com"....
what chang i should make in above code..so that it send mail from info@myserver.com".....
can anyone figure it out....
Sending Mail from mail() Function
Moderator: General Moderators
-
saadatshah
- Forum Newbie
- Posts: 23
- Joined: Fri Jul 05, 2002 5:50 am
- Location: Lahore
i uselly use it like:
Code: Select all
mail("$email","$subject","$body","From:$from");-
saadatshah
- Forum Newbie
- Posts: 23
- Joined: Fri Jul 05, 2002 5:50 am
- Location: Lahore
hi,
thx dear its workin...but one problem is this....the mail script i ve written above take 2 long 2 finish.....
sometimes it gives the zero sized rely error...and sometimes it gives script time out error...but in all the cases...the recepient recieve the mail .......now tell me how can i remove this problem...and mak my script fast ....i m in a waiting condition...so plz asnwer fast....
thx
thx dear its workin...but one problem is this....the mail script i ve written above take 2 long 2 finish.....
sometimes it gives the zero sized rely error...and sometimes it gives script time out error...but in all the cases...the recepient recieve the mail .......now tell me how can i remove this problem...and mak my script fast ....i m in a waiting condition...so plz asnwer fast....
thx
If you script gives 'Time out' use this in begin of file
This wll fix the 'time out' problem.
If u use the mail() functoin, header "From: nobody@something.com" is still send. You can solve this with Mail class comes with php source.
Sorry for my english
Code: Select all
set_time_limit(0);If u use the mail() functoin, header "From: nobody@something.com" is still send. You can solve this with Mail class comes with php source.
Sorry for my english