php send email help/idea needed

Posted on 2011-05-12
Last Modified: 2012-06-27

is it possible to send contents in a div as a email? anyone got a example of how to?

Question by:3xtr3m3d
    LVL 36

    Accepted Solution

    yes, you can send div based content using this standard phpmailer library.

    ref. PHP lib
    LVL 107

    Assisted Solution

    by:Ray Paseur
    The contents of email messages are strings of characters.  That means that you can send anything that is of the data type "string" including plain text, base64-encoded images, HTML and CSS, etc.  So if you have the contents of the div in a PHP string variable, you can send it in email.  You might want to check the mime type, and you might want to consider sending an alternate format, just in case your clients are not taking HTML email.

    If you have a serious application (one where your money and your time matter) you might want to consider using instead of sending your own emails.  If you send your own, you will spend a lot of non-value-added time debugging the email system.  If you use ConstantContact, you will save all of that time and effort and you can focus on the part of the application that adds value for your company and your clients.  Just a thought from someone who has been sending automated email since 1999 and who gave up and turned to ConstantContact in 2008.  I am never going back!

    best regards, ~Ray
    LVL 3

    Author Comment


    Thanks for the information guys, its really helpful. im gona use phpmailer though.

    so i can get div content using jquery and send to script using ajax. but still no idea how to add css stuff to it
    LVL 36

    Expert Comment

    by:Loganathan Natarajan
    Yes, you can include css on your mails using PHP Mailer, just check out this, Example with CSS

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now