Php Help please

thezone1

New Member
Messages
192
Reaction score
0
Points
0
Hey ppl i recently started teaching myself php,
im running through a few simple projects to get my wits about it but iv run into a dead end.....

I have got a local webserver set up to test my work but im stuck on a mailfunction, i made a simple form to get user feed back heres the php command


// process the email
if (array_key_exists('send', $_POST)) {
$to = 'me@example.com'; // use your own email address
$subject = 'Feedback from Japan Journey site';

// process the $_POST variables
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];


// build the message
$message = "Name: $name\n\n";
$message .= "Email: $email\n\n";
$message .= "Comments: $comments";
// limit line length to 70 characters
$message = wordwrap($message, 70);

// send it
$mailSent = mail($to, $subject, $message);
}

all the veriables are there and so on yet when i try to send it i get the error
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\WEBSERVER\ROOT\php\contact.php on line 25

in my php.ini file i have set the option to my x10 mail setting
?? any help is very apreciated thanks
 

thezone1

New Member
Messages
192
Reaction score
0
Points
0
I have version 5.2.4 on my local network and cannot change it as far as the hosting version is concerned i see no point in changing it lol ;) since i'm testing on my local network....
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Since you're on windows, you have to specify a smtp server in your php.ini

It should be in \windows\php.ini
 

thezone1

New Member
Messages
192
Reaction score
0
Points
0
i know and i set it to my hosting accounts outgoin mail server but i still get the error for some reason might it be the port?? or is their a way i can do a custom from header for that code ???

thanks in advance
 

Thewinator

New Member
Messages
256
Reaction score
0
Points
0
As far as I can tell: '"sendmail_from" not set'
Its not set at all. Make sure to restart your webserver after changing settings.
 

thezone1

New Member
Messages
192
Reaction score
0
Points
0
thanks for your reply, i have set it here are the settings

[mail function]
; For Win32 only.
SMTP = mail.thezone.x10hosting.com
smtp_port = 25

;For Win32 only.
sendmail_from = 'admin@thezone.x10hosting.com' (i have tried this without quotes)

is there some way i have to set this other than this ???
this one is really givin me a headache now lol (im actualy considering givin up)

Again thanks for all replys
 

Thewinator

New Member
Messages
256
Reaction score
0
Points
0
try phpinfo();
to check if the settings are actualy working.
otherwise you might be looking at the wrong ini file?
 

nakg0d

New Member
Messages
70
Reaction score
0
Points
0
there are several php.ini files with some PHP installations, such as xampp.

i had some trouble configuring the cURL library locally some months ago, but i realized that i was editing the incorrect settings file
 

thezone1

New Member
Messages
192
Reaction score
0
Points
0
gez lol so how do i find out where the right file is ??

i realli do hope php gets easier lol
 

rickle42

New Member
Messages
59
Reaction score
0
Points
0
I tried setting up my own server to learn php. Then I realized that I needed to install a mail server, tried it , gave up and got an x10 account.
Did you install a mail server?
 

thezone1

New Member
Messages
192
Reaction score
0
Points
0
nah iv installed php and apache i was thinkin about a mail server but decided against it lol
Edit:
you can however get a simple piece of software to do a mail server called

agrosoft mail server (since your only using it local id recommend you just download the torrent for testing purpose's only, if you like it buy it )
 
Last edited:
Top