Pages: [1]   Go Down
Send this topic | Print
Author Topic: Advantages of SMTP over sendmail()?  (Read 1724 times)
Ben3
Active Member
**
Offline Offline

Posts: 70


« on: May 10, 2008, 08:27:27 PM »

Could someone enlighten me as to what the difference between the both is and which one is better to use and why they think that? thankyou.
Logged
robleyd
Official 110mb Guru
********
Offline Offline

Posts: 5700

Ask before you PM


« Reply #1 on: May 10, 2008, 08:48:11 PM »

That is like asking which is better, HTTP or Internet Explorer.

SMTP (Simple Mail Transfer Protocol) is a standard for the transmission of email, and sendmail is an application (one of many) that sends mail using the SMTP standards. Just like HTTP is a protocol for web pages, and Internet Explorer is an application (one of many) that uses the HTTP standards to request web pages.

Perhaps what you are really wanting to know is the difference between using mail() and fsockopen() for sending mail from 110mb?
Logged

I once had a hard drive clunk-clicking
Strange noises, weird sounds and tick-ticking
I thought I would wait
And procrastinate...
But now all my data is missing
--------------
dd, a dump, a data dump
read a line from standard in
$USER, the name I call my self
make - a long long time to run
.so a library that is shared
.ko it's not the same as .so
tee, a redirect with in and out
and brings us back to dd d d d
Alejandro
Active Member
**
Offline Offline

Posts: 67


WWW
« Reply #2 on: May 11, 2008, 02:38:05 AM »

The answer to which one is better it depends. As robleyd stated, SMTP is the protocol and sendmail is an application that implements SMTP.

This mostly depends on the programs and/or scripts that you are using.  There are scripts that would use SMTP directly while others would use the UNIX sendmail command to send e-mail.  The best would implement both.

So, if you are trying to decide which one to use, then see what the script recommends (or what is its default value) and go for that one.

If you are writing your own script, the decision of using sendmail or use SMTP directly is a matter of personal choice.  A lot of times there are libraries that will hide the complexities of SMTP so both are equally easy to use.

My personal preference when writing my own scripts is to use SMTP directly (or use a library to do it for me) as these tend to be more portable than using sendmail.  (i.e the same code will work on Linux/UNIX and on Windows).
Logged
meep-online
Authority Member
****
Online Online

Posts: 986


WWW
« Reply #3 on: May 11, 2008, 03:03:19 AM »

I think he means whats the best one to use to send mails from a php application :\

If so, sendmail is simpler, but requires it to be activated.
Logged

aldo
Official 110mb Guru
********
Offline Offline

Posts: 8004


SMF is ftw :D


WWW
« Reply #4 on: May 11, 2008, 03:10:25 AM »

fsockopen() though can be used by other applications for other reasons Smiley I would go activate fsockopen still even if you bought sendmail Wink
Logged


Alejandro
Active Member
**
Offline Offline

Posts: 67


WWW
« Reply #5 on: May 11, 2008, 04:56:57 AM »

I would disagre with meep-online when it is mentioned that sendmail is simpler.

Either would have the same level of simplicity.  If your script only supports sendmail, that is the way to go.  If your script does not use sendmail (i.e. fsockopen), then it will use SMTP protocol directly.

On the other hand, if it can do either, it is just a configuration setting so both are equally simple to use.

If it was me, I would use fsockopen, and get a PHP class to handle the work of talking the SMTP protocol.  Which would make it as simple as using sendmail.  (OK, yes, I give up, so sendmail you have it already, while the former you would need to find the PHP class first...)
Logged
meep-online
Authority Member
****
Online Online

Posts: 986


WWW
« Reply #6 on: May 11, 2008, 08:15:34 AM »

Yeah but you have to open a smtp email account if u want to do it via smtp, hence the less simplicity.
Logged

Pages: [1]   Go Up
Send this topic | Print
Jump to: