timeline Posted May 23, 2008 Share Posted May 23, 2008 hi friends, iam developing a php application in linux to send mail i have got the smtp host account from a open source mail client. in windows if we want to send a mail using php we can edit the php.ini file in the server & add the smtp host name etc., and we can use the mail function in php to send the mail In linux, i have no idea, how to configure the smtp settings etc., & wat php functions can b used to send the mail ??? so please reply me with the list of methods & steps to configure the mail in Linux thank u ?? Link to comment https://forums.phpfreaks.com/topic/106918-need-help-with-php-maillinux/ Share on other sites More sharing options...
whiterabbit Posted May 23, 2008 Share Posted May 23, 2008 If it is like most Linux boxes, it should have sendmail installed on it. If that is the case, you should just be able to use the built in mail() command from php. Have you tried that? $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: Someone <[email protected]>\r\n"; $subject = "Put subject here"; $message = "<br> Put your message here. "; $to = "[email protected]"; mail($to, $subject, $message, $headers); You can specify who it comes from via the headers and this also controls the 'reply to address' (see the 'From line in the headers variable). I realize that you wanted help setting up the smpt settings, but I thought this might be a bit easier if you haven't already tried this. My apologizes if you already have. Link to comment https://forums.phpfreaks.com/topic/106918-need-help-with-php-maillinux/#findComment-548022 Share on other sites More sharing options...
timeline Posted May 25, 2008 Author Share Posted May 25, 2008 Hi whiteRabbit, thanks for ur help? & can u help me in setting up the smtp settings for linux thank u Link to comment https://forums.phpfreaks.com/topic/106918-need-help-with-php-maillinux/#findComment-549544 Share on other sites More sharing options...
trq Posted May 25, 2008 Share Posted May 25, 2008 Setting up an smtp server in Linux is not a simple task, nor is it related to php. If you want simular functionality to that available in windows install a program called ssmtp and read through the config file (its well commented). Link to comment https://forums.phpfreaks.com/topic/106918-need-help-with-php-maillinux/#findComment-549549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.