Click to See Complete Forum and Search --> : how to send mail from a PHP script (or anything)


bluflamez09
09-22-2006, 02:35 PM
Don't interpret my question wrong, the actualy PHP script is not my problem. My problem lies in the fact I don't know HOW to make the server send it once it's requested. I used a payed host which, of course, had a fully functioning server that could send mail so of course the scripts worked. But now that I'm trying to set up my own server, I don't know how to make that happen. What do I need to install? My OS is ubuntu linux.

Phill Pafford
09-22-2006, 02:52 PM
You need L.A.M.P.

Linux, Apache, MySQL & PHP

Do you have all this installed?

You also will need a mail server installed like

Squirrel Mail to send from your own server

bluflamez09
09-22-2006, 04:18 PM
Thank you! I will install squirril mail! Yes I have a LAMP package installed, XAMPP. I will try squirrilmail. I always thought that Squrril Mail was just a UI for acessing your mail, I didn't know it did all the mail sending stuff. Thanks again, you don't know how long I've been trying to find an answer lol, I feel dumb :eek:

NogDog
09-22-2006, 04:28 PM
You can use SMTP to send mails via a SMTP mail account (for instance on your ISP's mailserver). The PHPMailer Class (http://phpmailer.sourceforge.net/) includes a SMTP class, which can make the whole process fairly painless.

bluflamez09
09-22-2006, 04:54 PM
Hmmm I don't think squirrelmail is what I wanted.. I think it was an interface like I orginally thought. Am I wrong? It asked me if I wanted to use sendmail or SMTP to send stuff and I though... "Well isn't that what this is?"

Here's what I read on wikipediaSendmail was one of the first (if not the first) mail transfer agents to implement SMTP. As of 2001 there are at least 50 programs that implement SMTP as a client (sender of messages) or a server (receiver of messages). Some other popular SMTP server programs include Postfix, qmail, Novell GroupWise, Exim, Novell NetMail and Microsoft Exchange Server.Don't I want something like Postfix? I don't really care about RECIEVING emails though, I just need something that will SEND emails. Do you guys understand what I need? Or am I just so confused I'm not even able to descibe what I need well enough? lol

All I have right now is PHP, MySQL, and proftp. What else do I need to send emails from my server? The reason I doubt the mailer class is this:As you (might) know, you can already send mails with the php mail() function. So why do you need a class? Isn't it slower? - Yes that's true. But you don't pay a price if you won't get anything for it...If I can already send mail with php mail(), then why do I need this again?

NogDog
09-22-2006, 05:31 PM
The PHP mail() function when used on a UNIX/Linux server by default calls the sendmail() program which is normally part of the OS installation. Windows does not have that specific program, so in order to use PHP's mail() function, you need to configure it to call a program on the Windows machine which provides the same functionality and either has the same API as sendmail or has a "wrapper" script for it which does.

As in my prior reply, I find it easier on my local PC installation to just use SMTP instead of a sendmail clone, using PHPMailer and its SMTP class, entirely bypassing the use of PHP's mail() function.

bluflamez09
09-22-2006, 06:58 PM
The PHP mail() function when used on a UNIX/Linux server by default calls the sendmail() program which is normally part of the OS installation.I'm using Linux... does that mean that it SHOULD'VE worked out of the box? Since it's not working, what do I need to install now that you know I'm running Linux?