944,059 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 21548
  • PHP RSS
Jan 17th, 2007
0

SMTP mail settings with PHP

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
irotsenmar is offline Offline
15 posts
since Oct 2006
Jan 17th, 2007
0

Re: SMTP mail settings with PHP

As the warning suggests, use ini_set():
[php]
ini_set("smtp_port","25");
[/php]
change the port to required.
Reputation Points: 13
Solved Threads: 2
Junior Poster
php_daemon is offline Offline
138 posts
since Aug 2006
Jan 17th, 2007
0

Re: SMTP mail settings with PHP

i searched the source code of all the pages and couldn't find ini_set
Reputation Points: 10
Solved Threads: 0
Newbie Poster
irotsenmar is offline Offline
15 posts
since Oct 2006
Jan 18th, 2007
0

Re: SMTP mail settings with PHP

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);
Reputation Points: 10
Solved Threads: 0
Newbie Poster
azarudeen is offline Offline
10 posts
since Dec 2006
Jan 18th, 2007
0

Re: SMTP mail settings with PHP

Click to Expand / Collapse  Quote originally posted by irotsenmar ...
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 4:25 pm. Reason: Sentance corrections
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mbacon is offline Offline
19 posts
since Jan 2007
Jan 22nd, 2007
0

Re: SMTP mail settings with PHP

Thanks
I got the same issue Its very useful for me Thanks for your replay
Reputation Points: 5
Solved Threads: 5
Junior Poster
vssp is offline Offline
197 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: web design
Next Thread in PHP Forum Timeline: impose a limitation on form of time duration





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC