By Kartic Krishnamurthy on August 7, 2000 Tired of sending those drab textual notifications and newsletters to your friend and clients? Ever wanted to send attachments and/or HTML embedded email. The answer is MIME. The ensuing few pages explain the basics of MIME, creating MIME-compliant messages and then ends with…
PHP Tutorials
Whether just getting started or an expert, this vast collection of PHP tutorials will help you create dynamic content for powerful web-based applications in no time.
By Kartic Krishnamurthy on August 7, 2000 “Okay, how do I create MIME Compliant Messages?” With the above general description, let us now look at what exactly is in this so-called MIME Message! The Simplest MIME Message This message has no parts to it, i.e., no “attachments”. Nevertheless, for it…
By Kartic Krishnamurthy on August 7, 2000 The MIME Class With these basics in mind, let us build and implement a MIME mail class in PHP. In our PHP arsenal, we already have the necessary tools to do the encoding! The MIME class must have the ability to: Add attachment(s)….
By Kartic Krishnamurthy on August 7, 2000 The next method we will be examining, build_message(), does the bulk of all this work but is invoked via one gen_email() method. Please note that build_message() is a private method. <?php function build_message() { $msg = “”; $boundary = ‘PM’.chr(rand(65, 91)).’——‘.md5(uniqid(rand())); # Boundary marker $nparts = sizeof($this->mimeparts); // Case 1: Attachment list is there. Therefore MIME Message header must have multipart/mixed if (is_array($this->mimeparts) && ($nparts > 1)) { $c_ver = “MIME-Version: 1.0″.CRLF; $c_type = ‘Content-Type: multipart/mixed;’.CRLF.”tboundary=”$boundary””.CRLF; $c_enc = “Content-Transfer-Encoding: “.BIT7.CRLF; $c_desc = $c_desc?”Content-Description: $c_desc”.CRLF:””; $warning = CRLF.WARNING.CRLF.CRLF ; // Since we are here, it means we do have attachments => body must become an attachment too….
By Kartic Krishnamurthy on August 7, 2000 Two other methods that are worth mentioning are print_mail() and send_mail(), both taking the $force argument. print_mail() prints the entire email message and send_mail() sends the message using the PHP mail() function. Optionally, send_mail() uses an SMTP object and it’s send method (both…
Learn how to implement the client-side component of a newsletter subscription popup window using jQuery, SimpleModal and jQuery-cookie. With this
Learn how to implement the client-side component of a newsletter subscription popup window using jQuery, SimpleModal and jQuery-cookie. With this
To avoid the common pitfalls in email retrieval, Jochen Staerk discusses how to recieve and process email using
To avoid the common pitfalls in email retrieval, Jochen Staerk discusses how to recieve and process email using
To avoid the common pitfalls in email retrieval, Jochen Staerk discusses how to recieve and process email using