Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
PHP multipart mail not showing on Mac's
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- PHP multipart mail not showing on Mac's
PHP multipart mail not showing on Mac's
28-11-2008 2:51 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I'm sending some emails from PHP -
And the header is:
So what have I done wrong or is it just a few old Mac who's will never be able to read anything?
mail($to, $subject, $emailbody, $headers);using a multipart, and most PC boys are fine, but it seems everyone using a Mac says nope can't see a thing stop sending me blank emails. So looking for anyone who's done this and got it working. The $emailbody is:
YOUR EMAIL READER DOES NOT SUPPORT MULTI-PART DOCUMENTS
BLAH BALH BLAH
--PHP-alt-THISISMARTINLIVEBOOKINGCONTENTBOUNDARY
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
YOUR EMAIL READER DOES NOT SUPPORT HTML DOCUMENTS
BLAH BALH BLAH
--PHP-alt-THISISMARTINLIVEBOOKINGCONTENTBOUNDARY
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Here's a nice HTML document
<BR><BR> So good that you can read it properly.
--PHP-alt-THISISMARTINLIVEBOOKINGCONTENTBOUNDARY
And the header is:
Content-Type: multipart/alternative; boundary="PHP-alt-THISISMARTINLIVEBOOKINGCONTENTBOUNDARY"
MIME-Version: 1.0
X-Mailer: PHP v4.3.9
From: Martin <martin@thisismartin.co.uk>
So what have I done wrong or is it just a few old Mac who's will never be able to read anything?
Message 1 of 4
(5,023 Views)
3 REPLIES 3
Re: PHP multipart mail not showing on Mac's
28-11-2008 3:46 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Mail is finicky. Have you tried it with a final -- (double hyphen, no space) after the last boundary?
Gabe
Gabe
Message 2 of 4
(3,911 Views)
Re: PHP multipart mail not showing on Mac's
28-11-2008 4:13 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
IIRC you need to have some extra headers, along the lines of:
Although personally I think HTML email is evil, different strokes for different folks I guess
MIME-version: 1.0
Content-type: multipart/alternative;
boundary=--PHP-alt-THISISMARTINLIVEBOOKINGCONTENTBOUNDARY
Although personally I think HTML email is evil, different strokes for different folks I guess
Message 3 of 4
(3,911 Views)
Re: PHP multipart mail not showing on Mac's
29-11-2008 11:39 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi Gabe,
After much fiddling I stumbled across the requirement to have a double hypen (--) at the end of the last boundaray statement. Thanks to gmail.com which was also as picky as the Mac users and now everyone can read all that I send them
I'm also sending the message in plain text so that all those can't / won't read HTML can still get the jist of what we're saying.
So all solved.... Onto the next problem now....
After much fiddling I stumbled across the requirement to have a double hypen (--) at the end of the last boundaray statement. Thanks to gmail.com which was also as picky as the Mac users and now everyone can read all that I send them
--PHP-alt-THISISMARTINLIVEBOOKINGCONTENTBOUNDARY--
I'm also sending the message in plain text so that all those can't / won't read HTML can still get the jist of what we're saying.
$plaintext = ereg_replace ("<([^<>]*)>", "", $plaintext );
$plaintext = ereg_replace ("£", "GBP ", $plaintext );
$plaintext = ereg_replace ("[\t]*","",$plaintext);
$plaintext = ereg_replace ("\r[ \t\r\n\v\f]*\r","\r\n",$plaintext);
So all solved.... Onto the next problem now....
Message 4 of 4
(3,911 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- PHP multipart mail not showing on Mac's