...

View Full Version : Mail and SMTP



celestine
12-10-2003, 12:28 PM
Hi all

My host told me there was spamming reported on the server and they are going to disable the mail() function and told us to use SMTP to send mail instead.

Well, I've always been rather hazy over the two mail function. In fact, I always thought they were the same. :confused:

I have several scripts using the mail(); function and I doubt I'll be able to send out emails when the server starts disabling mail().

Can someone tell me what's the difference between mail and smtp? and if I'll have to change alot of my code just to use smtp to send out my emails.

Thanks.

firepages
12-10-2003, 01:20 PM
SMTP is a protocol that mail servers use to talk to anyone trying to send mail through them , its a challenge/response protocol as in HTTP, FTP etc , so its not actually a function.

To use PHP to do SMTP you need to use the socket functions or streams , which is not straightforward so I suggest you look for an existing SMTP script or class at somewhere like hotscripts.com or phpclasses.org.

There are some great SMTP scripts around but generally they are OOP (using classes) so look for one that provides examples if you are not used to that.

... the problem you are going to have is with ready-made scripts that probably utilise the mail() function (many forums for example) , so you will either need to hunt down all the mail() calls in those scripts and replace them , OR get software that already uses SMTP scripts instead of mail() (FUDforum , PHPbb etc)

....note one could say to ones host that, this is thier problem not yours , there are ways of configuring sendmail or whatever mailserver they are using to stop spam at its source and look for spam like activities , some hosts will limit sendmail to $x mails per minute per user for example, personally I would be asking my host to track down & ban the abusers rather than let everyone else suffer .... but thats probably easier for me to say than for them to implement :D

celestine
12-11-2003, 01:51 AM
thank you so much firepages. I looked at some of the SMTP scripts and I must say they are a bit complex for me, though if I really have to use them, I will make it a point to learn. :)


....note one could say to ones host that, this is thier problem not yours , there are ways of configuring sendmail or whatever mailserver they are using to stop spam at its source and look for spam like activities , some hosts will limit sendmail to $x mails per minute per user for example, personally I would be asking my host to track down & ban the abusers rather than let everyone else suffer .... but thats probably easier for me to say than for them to implement

hehee. I agree, and luckily after I sent a support ticket, they told me i'm not on the server that's implementing this. So i'm not affected afterall, which is a major relief. Hunting all those mail() calls is going to be messy.

Thanks for all your help. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum