Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    May 2002
    Posts
    139

    Default cron sends html source not a html email

    i have setup a cron job to yrun a php script - the scrip, if run from a browser shows the results fine but when the cron runs it - the email i get has just the source code in it rather than a html page. how do i get it to send as a html email ???

    i get


    Content-type: text/html
    X-Powered-By: PHP/4.3.9

    <html>
    <title>the hello page</title>
    <head>
    <body>
    hello world
    </body>
    </html>


    instead of just

    hello world


    any advise would be great

  2. #2
    Member
    Join Date
    Apr 2003
    Posts
    479

    Default

    I don't think there's any way to send html mail with cron. I suppose you could send the email in the script and have no output. My advice would be to just remove all the html from the script that is being run in cron.

  3. #3
    Member
    Join Date
    May 2002
    Posts
    139

    Default

    Quote Originally Posted by elleryjh
    I suppose you could send the email in the script and have no output.
    thats a good idea - didnt think of that

    Thanks

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Indeed. If you want HTML emails, you'll need to modify your PHP script to send out the email and set the content-type in the email header to text/html. You cannot expect cron to do that, it simply sends a plain text email when reporting output.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. Cron senddigests sends daily email error
    By rmiles in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-09-2008, 11:27 AM
  2. inserting external html files into a html file
    By ezcybersites in forum New User Questions
    Replies: 1
    Last Post: 08-26-2006, 11:33 PM
  3. whm sends out email in text instead of html
    By NoAgendas in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-04-2006, 08:09 PM
  4. Choosing preference between index.html & default.html etc
    By thedjmixman in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 05-01-2004, 12:24 AM
  5. frontend/bluelagoon/cron/simplecron.html?
    By mitul in forum Themes and Branding
    Replies: 4
    Last Post: 05-24-2003, 09:08 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube