Replace mail() function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kurtenc
Forum Newbie
Posts: 2
Joined: Mon May 21, 2007 2:46 am

Replace mail() function

Post by kurtenc »

I am running php4/apache on windows2000. The PHP application i run uses the mail() function at numerous places in the code.

Problem is that the built-in mail() function does not support SMTP authentication. I absolutely need this as the server is situated in such a way that it cannot run its own mailserver.

Is there a way to replace the mail() function (by recompilation, a dirty hack or whatever) so that it uses the login credentials of one's choice, but otherwise works exactly as previously?

I've done some pretty hefty Google searching on the matter. There are solutions to the problem such as using the smtp.send class or PEAR mail package, but all those seem to involve a fair deal of editing the application's source code.

(The PHP application in question is WebCalendar, if that matters - maybe there's a rewritten version somewhere ready to use fancier mail functions?).

Thanks in advance!!

// Kurten
kurtenc
Forum Newbie
Posts: 2
Joined: Mon May 21, 2007 2:46 am

Post by kurtenc »

I fixed it by using the smtp_mail class and doing find-replace in the programcode. Thanks anyway...
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Swiftmailer is the beez neez. We all heavily promote its use. :D
Post Reply