Set php.ini for sending mail
Moderator: General Moderators
Set php.ini for sending mail
Hello to all,this is my first message in your forum.
I am trying to find my error. I have set the php.ini with my custom settings(smtp,mail address)
i have did the same with the php5.ini,with the same file in the apache/bin folder, and i create this php file:
<? php
mail('mymail','The site Contact us','eee');
?>
and when i am trying to run it, i am seeing this:
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\mail.php on line 2
If i write this:
<?
mail("my mail","test","Ok, it works");
?>
I will see this:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\mail.php on line 2
Please if anybody wants may help me?
I am trying to find my error. I have set the php.ini with my custom settings(smtp,mail address)
i have did the same with the php5.ini,with the same file in the apache/bin folder, and i create this php file:
<? php
mail('mymail','The site Contact us','eee');
?>
and when i am trying to run it, i am seeing this:
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\mail.php on line 2
If i write this:
<?
mail("my mail","test","Ok, it works");
?>
I will see this:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\mail.php on line 2
Please if anybody wants may help me?
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Set php.ini for sending mail
Ditch windows and move to linux! Problem solve. No stupid remote mail server setup, linux takes care of it all. The mail function will just work out of the box!
Re: Set php.ini for sending mail
My friend this ain't a solution.Somebody else who knows about it?Help pls help...i am going to disappoint.
Re: Set php.ini for sending mail
jaoudestudios's advice is a good one 
Anyway... You have to configure your PHP - in php.ini you'll find:
change'em to apropriate ones and restart Apache service...
Anyway... You have to configure your PHP - in php.ini you'll find:
Code: Select all
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = me@example.comThere are 10 types of people in this world, those who understand binary and those who don't
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Set php.ini for sending mail
Thanks
I could never get WAMP working with a remote mailserver, or a local one for that matter. So I changed to LAMP a long while back and have not looked back since!
I could never get WAMP working with a remote mailserver, or a local one for that matter. So I changed to LAMP a long while back and have not looked back since!
Re: Set php.ini for sending mail
VladSun i 've did it a lot of times but nothing...
Re: Set php.ini for sending mail
Create a file in you www directory, containing:nikpony wrote:VladSun i 've did it a lot of times but nothing...
Code: Select all
<?php phpinfo(); ?>BTW: There should be no ";" in front of
Code: Select all
SMTP = put_your_smtp_server_here
smtp_port = 25
sendmail_from = some_user@your_domain.comThere are 10 types of people in this world, those who understand binary and those who don't
Re: Set php.ini for sending mail
THANK YOU THANK YOU THANK YOU!YOU SOLVE ME.