문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top