- Site Template
- WordPress Theme
- Blogging Theme
- CMS Theme
- Marketing Template
- eCommerce Theme
- Forum Theme
- Flash Template
- PSD Web Template
- .NET Script
- PHP Script
- HTML5 Code
- CSS Style
- Edge Animate Template
- Muse Template
- TypeEngine Theme
- Static Site Generator
- Sketch Template
CodeCanyon MailHub 5532434
PHP Script \ Miscellaneous
Plain \ Mailer \ Mail \ Custom \ Html \ Attachment
PHP Script - MailHub 5532434 by christophdb @ CodeCanyon
PHP Script \ Miscellaneous
Last Update: 9 September 13; Compatible Browsers: IE6, IE7, IE8, IE9, IE10, Firefox, Safari, Opera, Chrome; Software Version: PHP 4.x, PHP 5.x, PHP 5.0 - 5.2, PHP 5.3, PHP 5.4, PHP 5.5; High Resolution: No; Files Included: PHP.
Usage of MailHub
On basically all my webprojects I have to send emails to somebody. The users wants to get a new password or I want to send a confirmation or an error report to a specific email address. Of cause you simply could use the mail function of php but as soon as you want to send HTML mails or mails with an attachment it becomes a little bit tricky. Also if you need some dynamic error reporting…
Therefore I wrote this “MailHub class” to reduce the necessary time to develop email notifications. Usually I define a set of emails with placeholders and replace the placeholders dynamically. In this way I am very flexible and can implement email notifications within seconds.
I created some examples to show you how easy you can use this PHP class. The source code should enable you to boost your learning curve of this class functions. In the end there is a complete list of the public functions of this class.
I hope this class saves you a lot of time so you can focus on the real challenging programming tasks.
- “MailHub” is simple and flexible
– send mails within seconds
– define mail templates and send them easily
– test it out
- Plain or HTML e-Mails
- simple placeholder replacement for customized mails
- easy template defination and usage
- supports multiple attachments
- simple debugging
- check out the demo at http://www.bigtoe.de/demo/mailHub
Public functions of “MailHub”
- setTo( string $email [, string $name = false] )
define a recipient of the mail (Use the function multiple times if you want to define multiple recipients)
- setCC( string $email [, string $name = false] )
define a emailadress (with or without a name) that should receive the mail on cc: (Use the function multiple times if you want to define multiple recipients)
- setBCC( string $email [, string $name = false] )
same like setTo or setCC only for blind carbon copy (BCC)
- setFrom( string $email [, string $name = false] )
define the email (and the name) from the sender of the mail.
- setBody( string $body )
define/load the body of the email.
- setSubject( string $subject )
define/load the subject of the email.
- setMailType( string $type )
choose between plain or html email type. If you choose html type you have to define the SMTP values in the mailhub_class.php. Default value is plain.
- replacePlaceholders( array $replacements )
This function could be used to replace placeholders in the mail body. Placeholders are always text snippets surounded with an opening # and an ending # (like #surname#). See the examples to get a feeling of the usage.
- addAttachment( string $file )
you can use the addAttachment function in two ways to add an attachment to the email (could be used with plain and html mails).
– either you add a relative path like “logo.png” or
– you enter the name value of an input field (input type=’file’ name=’xxx’).
use debug to get further information or to search for errors.
this function sends the mails.
use this function to check if the mails were send out correctly. send() will returns true or false and you can print a success or failure message based on that information.
Please help me
If you are going to rate the script less than 5 stars, please tell me what I can do to make it 5 stars for you and I will fix it. I would love to hear your suggestions on how I could improve the script, leave me a comment or send me an email and your suggestion might make it in to a future version!
Forms and Validation; Vacation and Travel Management Tool; Translate PHP class; File Protect.
Keywords: attachment, custom, html, mail, mailer, php, plain.
Android, Builder, Business, Clean, Corporate, Creative, Design, Ecommerce, Email, Fashion, Gallery, Image, Iphone, Jquery, Landing, Magazine, Magento, Marketing, Minimal, Mobile, Modern, Multi, Multipurpose, Parallax, Personal, Photography, Plugin, Portfolio, Product, Responsive, Retina, Simple, Slider, Social, Store, Template, Theme, Video, Woocommerce, Wordpress
Show all tags
Show all tags
- ThemeForest Nomad Business & Coworking Space Theme 18447575
- ThemeForest Pokemgo WordPress Theme for tutorials learning guides tips and tricks 17689202
- CodeCanyon Math Genius 2 Educational HTML5 Game 18438204
- ThemeForest Giraffe Kid Education Learning PSD Template 18417130
- ThemeForest Apolo Premium Photography & Portfolio PSD Template 18422911
- ThemeForest Aviato Multipurpose PSD Template 18420950
- ThemeForest Agora AJAX WooCommerce Theme 17504300
- ThemeForest ZIZOU A Minimalistic Personal Blog 18409050
- ThemeForest Logistic Pro Transport Cargo Online Tracking Booking Portfolio WordPress Theme 17622346
- ThemeForest Kodium Professional Portfolio & Agency Theme 16572789