954,193 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

SMTP mail settings with PHP

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

irotsenmar
Newbie Poster
15 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

As the warning suggests, use ini_set():
[php]
ini_set("smtp_port","25");
[/php]
change the port to required.

php_daemon
Junior Poster
140 posts since Aug 2006
Reputation Points: 13
Solved Threads: 2
 

i searched the source code of all the pages and couldn't find ini_set

irotsenmar
Newbie Poster
15 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

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);

azarudeen
Newbie Poster
10 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 
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

mbacon
Newbie Poster
19 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

Thanks
I got the same issue Its very useful for me Thanks for your replay

vssp
Junior Poster
199 posts since Jul 2006
Reputation Points: 5
Solved Threads: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You