Question

I recently started working on a web project which was already in progress; the guy who built the foundation for it had the signup page sending the form fields to a formmail Perl script, so that he could get an email when a user signs up. I'm not familiar with Perl, and my inclination is to just use the PHP mail() function and drop the Perl script, rather than spend time trying to figure out how to use it correctly.

So, is there any good reason to keep using the Perl script, or should I just advise him to drop it in favor of PHP mail? Any pros and cons, or is it entirely subjective?

I realize that this question may be flagged as subjective; just looking for advice.

Was it helpful?

Solution

I'd recommend a third option: an external PHP mailer class, such as PHPMailer. This gives you the advantage of not mixing languages unnecessarily as well as not having to figure out the quirks of mail(). It also does things like SMTP email itself, if required, and can assemble attachments and alternate sections. mail() can do none of that.

PHP's mail() function needs to be caught and shot. It's one of the quirkiest and odd functions that PHP has and requires some knowledge of how SMTP and often MIME work to call. If you do want to figure out how to use, put it behind an API call once you have.

OTHER TIPS

If by formmail, you mean formmail drop it immediately, and replace with something better designed and written like nms TFMail.

I do not know anything about said "php mail" to comment on that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top