Skip to content
Advertisement

Tag: email

Email validation using regular expression in PHP

I am pretty much new with regular expression. I am developing a project in PHP and i need to validate email address. After searching in this site and google i found the following regular expression says it should work best. But when I use it I get error says, What is wrong with this code? Answer Use this instead of

Find and replace emails and phone numbers in PHP

I was hoping for a little help on this, as it’s confusing me a little… I run a website that allows users to send messages back and forth, but on the inbox i need to hide both emails and phone numbers. Example: This is how a sample email would look like. Hi, my phone is +44 5555555 and email is

Send HTML in email via PHP

How can I send an HTML-formatted email with pictures using PHP? I want to have a page with some settings and HTML output which is sent via email to an address. What should I do? The main problem is to attach files. How can I do that? Answer It is pretty simple. Leave the images on the server and send

How to attach PDF to email using PHP mail function

I am sending an email using PHP mail function, but I would like to add a specified PDF file as a file attachment to the email. How would I do that? Here is my current code: Answer You should consider using a PHP mail library such as PHPMailer which would make the procedure to send mail much simpler and better.

How to set DSN (Delivery Status Notification) for PHPMailer?

I’m trying to find out how to set DSN when using PHPMailer. I know at the SMTP Protocol level, the DSN is specified after RCPT TO, e.g. RCPT TO: NOTIFY=SUCCESS,FAILURE ORCPT=rfc822;recipientemail@gmail.com Also, I will like to direct the DSN to other than the sender address if that is possible. Appreciate any pointers, thanks. Answer I discovered that PHPMailer doesn’t support

php email headers with MIME-Version: 1.0

I have these lines of code: I need the MIME type because I am using file_get_contents for an html file, my problem is under the headers it displays as “email@domain.comMIME-Version:1.0” and I want it just to say “email@domain.com” how do I take out the MIME type in the from displaying in the header? Thanks Answer Just add rn after the

Censor emails with PHP

I’m using this simple code: And i should get as output, something like ***@li.com; while i get ***@ I can’t debug it, i don’t know how what’s wrong. So the solution is I had to add () to make a group. Answer you need to create a group by adding (), and BTW it’s gonna be $1: also modified .+

php class to inline css styles?

I was over at MailChimp’s css inliner http://www.mailchimp.com/labs/inlinecss.php and I was wondering if there are any classes out there that can do this, I’d love to have it in my email code instead of going all the way over to MailChimp. Basically I’m looking for the code, behind the page or something very similar. Cheers. Answer You can try Premailer.

Advertisement