User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,659 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,797 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3745 | Replies: 5
Reply
Join Date: Oct 2006
Posts: 15
Reputation: irotsenmar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
irotsenmar irotsenmar is offline Offline
Newbie Poster

SMTP mail settings with PHP

  #1  
Jan 17th, 2007
I installed a help desk software that is coded in PHP. It has a feature that enables it to send out email when someone submits a troubleshooting ticket. I am unable to get the email function to work. The software is running on a remote server at a hosting company. How would I be able to get this feature to work without editing the php.ini file. (the hosting company doesnt allow modifications to the php.ini file since its in a shared environment) Thank you.

I am getting this error:

Warning: 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 d:\inetpub\redpaladin\support\admin\includes\mailtest.php on line 67
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2006
Posts: 138
Reputation: php_daemon is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 2
php_daemon php_daemon is offline Offline
Junior Poster

Re: SMTP mail settings with PHP

  #2  
Jan 17th, 2007
As the warning suggests, use ini_set():
[php]
ini_set("smtp_port","25");
[/php]
change the port to required.
Reply With Quote  
Join Date: Oct 2006
Posts: 15
Reputation: irotsenmar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
irotsenmar irotsenmar is offline Offline
Newbie Poster

Re: SMTP mail settings with PHP

  #3  
Jan 17th, 2007
i searched the source code of all the pages and couldn't find ini_set
Reply With Quote  
Join Date: Dec 2006
Posts: 10
Reputation: azarudeen is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
azarudeen azarudeen is offline Offline
Newbie Poster

Re: SMTP mail settings with PHP

  #4  
Jan 18th, 2007
hi,
now for that mail funcrion is working in your local host .if u work that paGE IN SERVER MEANS U CAN AVOID THAT ERRORS and functions will work properly u can also send mails also.if u want to avoid that errors in your localhost means put an @ symbol before that mail function like this for eg;

@mail($to,$subject,$message,$headers);
Reply With Quote  
Join Date: Jan 2007
Posts: 19
Reputation: mbacon is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mbacon mbacon is offline Offline
Newbie Poster

Re: SMTP mail settings with PHP

  #5  
Jan 18th, 2007
Originally Posted by irotsenmar View Post
i searched the source code of all the pages and couldn't find ini_set

The function ini_set will set the value you provide for the directive you specified, until the script ends.

See: http://ca.php.net/ini_set

You should check the 'SMTP' and 'smtp_port' directives because you seem to be unable to connect to your server using "localhost" on port 25. Contact your webhoster to find out the correct SMTP host & port.

See: http://ca.php.net/manual/en/ini.php#ini.list

Thanks, Mike
Last edited by mbacon : Jan 18th, 2007 at 3:25 pm. Reason: Sentance corrections
Reply With Quote  
Join Date: Jul 2006
Posts: 176
Reputation: vssp is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 4
vssp vssp is offline Offline
Junior Poster

Re: SMTP mail settings with PHP

  #6  
Jan 22nd, 2007
Thanks
I got the same issue Its very useful for me Thanks for your replay
Thanks
VSSP
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 1:39 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC