AXiSS Posted January 25, 2007 Share Posted January 25, 2007 I am running a Linux server, and need the ability to send email with the mail() function as part of the site I am building on it. I know that the setup for mail is edited in php.ini, but am not sure what the proper setup is.It will mainly be used for sending activation code emails, so it is necessary to use the mail() function.Can someone give me some pointers on what I need to do? Quote Link to comment https://forums.phpfreaks.com/topic/35614-mail-on-linux/ Share on other sites More sharing options...
trq Posted January 25, 2007 Share Posted January 25, 2007 Have you already got a mail server available to you? If so, you'll only need to install and configure an MTA, I would recommend [url=http://ftp://ftp.debian.org/debian/pool/main/s/ssmtp/]ssmtp[/url] as its really easy to configure.If you need to install a mailserver, its a much, much bigger job. You'll need to look at something like [url=http://www.postfix.org/]postfix[/url] but I'll tell you now, if your not a Linux sys admin, it will be a rather large learning curve. Quote Link to comment https://forums.phpfreaks.com/topic/35614-mail-on-linux/#findComment-168718 Share on other sites More sharing options...
AXiSS Posted January 25, 2007 Author Share Posted January 25, 2007 I asked the guy I bought it from about it, it has this "sendmail" program on it, but I don't know much about any of this stuff, so I don't know if I what I need to do...Could you define "mailserver" for me? Once again, I dont know much about this, but what I have here is a server hosting my website and all I want to be able to do is use the mail() function in PHP to send activation code emails for registered users... Quote Link to comment https://forums.phpfreaks.com/topic/35614-mail-on-linux/#findComment-169319 Share on other sites More sharing options...
trq Posted January 25, 2007 Share Posted January 25, 2007 Define 'mailserver'? It is the server that sends and receives email. If the server already has sendmail installed then you may already be good to go. Have you tried actually sending an email? Quote Link to comment https://forums.phpfreaks.com/topic/35614-mail-on-linux/#findComment-169399 Share on other sites More sharing options...
AXiSS Posted January 26, 2007 Author Share Posted January 26, 2007 Yes, using the:[code]$to = 'email@address.url';$subject = 'subject'$body = 'message'mail($to, $subject, $body);[/code]Code format, and in php.ini:[code][mail function]sendmail_path = /usr/sbin/sendmail -tsendmail_from = DO_NOT_REPLY@webaxiss.thathamkid.com[/code]With the php file:[code]<?php$to = 'wfabry@houston.rr.com';$subject = 'TEST';$message = 'test test test';mail($to, $subject, $message);header("Location:index.php");?>[/code]So, anything wrong that could be stopping it from emailing? Quote Link to comment https://forums.phpfreaks.com/topic/35614-mail-on-linux/#findComment-169411 Share on other sites More sharing options...
AXiSS Posted January 27, 2007 Author Share Posted January 27, 2007 OK, never mind, I have someone taking care of it. Quote Link to comment https://forums.phpfreaks.com/topic/35614-mail-on-linux/#findComment-170714 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.