ashii Posted March 30, 2009 Share Posted March 30, 2009 a Big Hi ;)to all the PHP Freaks members ........ I gona Start ma Career in PHP Freaks by Posting Ma Doubt..... i amjust trying on to send a mail using PHP. wher i followed W3schools Tutorials http://www.w3schools.com/php/php_mail.asp but i am failin to send it .... i think that i need to do sum configurations in ma PHP.ini file or somewhere.... can u please help me in this case ??? ??? ??? : :'( :'( regards.. Quote Link to comment Share on other sites More sharing options...
ratcateme Posted March 30, 2009 Share Posted March 30, 2009 well can you give us some more detail like what system are you using Linux or windows? and the php.ini values for SMTP, smtp_port and sendmail_path please if you dont have access to your php.ini create a simple script like <?php phpinfo(); ?> it will show all the details regarding your PHP configuration. Scott. Quote Link to comment Share on other sites More sharing options...
ashii Posted March 30, 2009 Author Share Posted March 30, 2009 well can you give us some more detail like what system are you using Linux or windows? and the php.ini values for SMTP, smtp_port and sendmail_path please if you dont have access to your php.ini create a simple script like Yeah!! Rat Am Workin in Windows... dis is the settings in PHP.INI file [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = "C:\xampplite\sendmail\sendmail.exe -t" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = the entire mail function is above... what is the changes that i have to do??? ??? ??? Thank u in Advance Quote Link to comment Share on other sites More sharing options...
ratcateme Posted March 30, 2009 Share Posted March 30, 2009 i see you are running a mail transport program? the current setup requires a mail server listening on port 25. i would advise you to get the full version of xampp as it has a mail transport system that can be used. Scott. Quote Link to comment Share on other sites More sharing options...
ashii Posted March 30, 2009 Author Share Posted March 30, 2009 i see you are running a mail transport program? the current setup requires a mail server listening on port 25. i would advise you to get the full version of xampp as it has a mail transport system that can be used. i hope that i use the fullversion of XAMMP... or can u gimme the link to download the full version this is the error that i get when i send the mail Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampplite\htdocs\mail.php on line 8 Quote Link to comment Share on other sites More sharing options...
ratcateme Posted March 30, 2009 Share Posted March 30, 2009 does your ISP provide mail services to you? if so your best bet at the moment is to set that section of you php.ini to ; For Win32 only. ;SMTP = localhost ;smtp_port = 25 ; For Win32 only. ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = "C:\xampplite\sendmail\sendmail.exe -t" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = go to C:\xampplite\sendmail\ and edit sendmail.ini so that it looks something like [sendmail] smtp_server=smtp.your.isp.com smtp_port=25 that way your mail will go to your ISP and then hopefully to you Scott. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted March 30, 2009 Share Posted March 30, 2009 ashii - post some of your code as it could be your headers that are malformed and stopping mail() from working. Quote Link to comment Share on other sites More sharing options...
ashii Posted March 30, 2009 Author Share Posted March 30, 2009 Cant V Use our Localhost as our SMTP server ???? and diz s ma code <?php $to = "ashii@gmail.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someone@yahoo.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> Quote Link to comment Share on other sites More sharing options...
Yesideez Posted March 30, 2009 Share Posted March 30, 2009 $headers = "From: $from\r\n"; Try that. Quote Link to comment Share on other sites More sharing options...
ashii Posted March 30, 2009 Author Share Posted March 30, 2009 $headers = "From: $from\r\n"; Try that. Yesideez.... Itz Not Workin Out............. i think it has a probz in the SMTP Servere check ma previous post for the Error ??? ??? Quote Link to comment Share on other sites More sharing options...
ratcateme Posted March 30, 2009 Share Posted March 30, 2009 you can but you need smtp server program running on it. one is included in the full version on xampp check out the xampp page for more details Scott. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted March 30, 2009 Share Posted March 30, 2009 I suggest you use phpmailer http://phpmailer.codeworxtech.com/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.