jonpugh114 — 2010-12-10T08:23:44-05:00 — #1
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?
immerse — 2010-12-10T10:02:39-05:00 — #2
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.
jonpugh114 — 2010-12-10T11:02:56-05:00 — #3
Any idea how I'd code the "click to view online" link into the email?
system — 2010-12-10T16:00:42-05:00 — #4
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.
jonpugh114 — 2010-12-13T07:53:30-05:00 — #5
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.
immerse — 2010-12-13T10:31:30-05:00 — #6
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?
system — 2010-12-13T16:00:07-05:00 — #7
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.