Validate an Email address

It's a common task to integrate email addresses to a web application. But how do we check them? How to make sure it's a valid Email Address? On which level?

PHP's mail() vs PHPMailer

As I had to build an online platform that started as a very small project, I was not concerned with using anything other than PHP's built in mail() function to send simple e-mails to the users - and it worked great! However, as the platform got larger, the requirements got larger too. Before long I was messing around with headers in the php mail() function to include attachments in e-mails etc. Turns out, adding the PHPMailer functionality makes the whole process a lot cleaner and easier to maintain as the project grows. By a simple function addAttachment($attachment) you hide the complexity and it even solved additional problems with ascii codings in mails. So if you have any idea that a project grows, think about planning ahead using a tested library. It would have saved me quite some trouble.
Subscribe to email