SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Gloucestershire, UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mime Mail problem

    Hello,

    I've got a problem with sending MIME mail using PHP. When it hits a Mac using Entourage all they see is the coding for the email, it appears that Entourage doesn't support the MIME format by default. Does anyone know a way around this? Or is there a way to add "If you can't read this email please click here" above the content?

    Cheers,

    Jon

  2. #2
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    Entourage should be able to display HTML mails, but...

    Sending HTML mail is criminally difficult using PHP.

    Might I suggest you use a library like PHPMailer or Swift (www.swiftmailer.org) to send mails, as they have all of this kind of stuff worked out? It'll make you life a lot easier

    It's a good idea to add a 'click here to view online' type link, but you'll need to code that yourself, and you'll also need to upload a copy of the mail onto your webserver where people can view the mail.

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Gloucestershire, UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any idea how I'd code the "click to view online" link into the email?

  4. #4
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Immerse View Post
    Sending HTML mail is criminally difficult using PHP.
    This tutorial shows an easy way using php mail().

    The tute also shows how to send a plain text and html version of the email content in the one email, which imho is good practice. This way the email client decides which version to display.

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Gloucestershire, UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems that the problem isn't with entourage, it appears to be when I send it to a network run off a local server the Mime format is ignored.

    Any ideas?

  6. #6
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Kalon View Post
    I looked at that turtorial, I don't really fancy coding up all the mime-boundaries and stuff when I need to attach a bunch of inline/ embedded images and other attachments. Let alone dealing with a bunch of server/ client discrepancies etc.

    I'll just keep using Swift etc, thanks


    @jonpugh: what exactly do you mean by:
    when I send it to a network run off a local server
    You're using a local mail server? Is it configured to allow/ use mime mails?

  7. #7
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Immerse View Post
    I looked at that turtorial, I don't really fancy coding up all the mime-boundaries and stuff when I need to attach a bunch of inline/ embedded images and other attachments. Let alone dealing with a bunch of server/ client discrepancies etc.

    I'll just keep using Swift etc, thanks
    yep no problem

    I used that code to build my own mail out script which retrieves the email content and mime type for any attachments from the database, inserts them in the appropriate locations in the script and it then sends both plain text and html format emails to recipients.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •