Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Couldn't work out which section this question is best suited, so I've plumped for the general one. Please be gentle with me!...
Very simply I'm trying to send some mail using mail() in a PHP page. Typical sort of code like:-
mail("email@example.com", "Xmas", "when is it");
I've got PHP running fine with apache, so that side of things is OK. I know I've got sendmail running from doing a 'ps', but not sure how it is configured and what I need to do to get it working with PHP/apache.
I'm using a dialup connection (I know, but I'm poor!) and my ISP which we'll call "dailup.org" for now. Assume I've got an email account with that ISP called "firstname.lastname@example.org" too.
So how to I sort out sendmail, to get this email to "email@example.com" from "firstname.lastname@example.org"?
Hopefully this is all easy for you geniuses out there! I've hunted around for tutorials and postings but not come up with anything particularly clear.
I'm just after a simple "get me going" sort of answer for now, thanks.
Go to www.php.net and look for the mail command on there. They have an example of what you are wanting to do.
There is a fourth argument you can pass called additional headers. In there you can set it so it looks like it came from someone other than you web server. I've done this in a couple of different php scripts without a problem.
There's a lot of postings on the "mail()" page on php.net! I couldn't really see anything which really explained how to use sendmail itself, rather lot of examples of PHP code, which I've got some grip on.
I did see one posting using a PEAR object which apparantly doesn't need sendmail, would that be a useful approach?
You probably need to take a look inside your php.ini file, usually in /usr/local/lib. Skip down to about line 510, at least that is where it shows up for me. This is the like you need to uncomment and modify to fit your system. In most set ups I've dealt with before using the suggested setting, on the line 509, was adequate.
After changing this setting you'll need to cycle your web server for the change to become effective. That's all there is to it, pretty simple on *NIX, different for WIN32.
I edited php.ini to change the mail settings so it looked at sendmail, and #ed out the Win32 related lines; but this still doesn't do anything.
How do I find out what sendmail is actually doing? It just seems to running in the background (I see when I do a 'ps'), but is there anywhere I can look to see if it is sending emails out, or receiving information to do so?
I tried that, but it seems the -v option is for the version of mail, not the verbose mode. I looked at mail's option list but couldn't see a verbose option.
I assume there are very different versions of mail around.