473,657 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Apple Mail sees attachment in generated email but cannot open

Hi folks,

I have a PHP cron job that compiles a CSV from queries and emails it
to some clients. I have a complaint that one client can see the
indicating icon to say there is an attachment in his Apple Mail but
attempts to open it fail. If he forwards the email to Gmail he can
open the attachment from there so it is a mail client issue, not a
file issue.

This sounds to me like maybe the boundaries I am setting have issues?
Anyone have experience or ideas about a fix? Here is the offending
function.

TIA!

JG
function sendAttachment( $csvName, $message, $emails) {
$csv = implode('', file("reports/$csvName.csv")) ;
$date = date( 'r' );
$phpversion = phpversion();
$boundary = md5( time() );
$filename = "$csvName.c sv";
$headers = <<<END
From: my*******@cox.n et
Reply-To: my*******@cox.n et
Return=Path: my*******@cox.n et
Date: $date
X-Mailer: PHP v$phpversion
MIME-Version: 1.0
Content-Type: multipart/related; boundary="$boun dary"
END;

$message = <<<END
--$boundary
Content-Type: text/plain; charset="iso-9959-1"
Content-Transfer-Encoding: 7bit

$message

--$boundary
Content-Type: octet-stream; name="$filename "
Content-Disposition: attachment; filename="$file name"
Content-Transfer-Encoding: 7bit

$csv

--$boundary--

END;

return mail( join($emails, ','), $csvName, $message, $headers );
} // func
Mar 24 '08 #1
1 2401
On Mar 24, 1:42 pm, jerrygarciuh <jerrygarc...@g mail.comwrote:
Hi folks,

I have a PHP cron job that compiles a CSV from queries and emails it
to some clients. I have a complaint that one client can see the
indicating icon to say there is an attachment in his Apple Mail but
attempts to open it fail. If he forwards the email to Gmail he can
open the attachment from there so it is a mail client issue, not a
file issue.

This sounds to me like maybe the boundaries I am setting have issues?
Anyone have experience or ideas about a fix? Here is the offending
function.

TIA!

JG

function sendAttachment( $csvName, $message, $emails) {
$csv = implode('', file("reports/$csvName.csv")) ;
$date = date( 'r' );
$phpversion = phpversion();
$boundary = md5( time() );
$filename = "$csvName.c sv";
$headers = <<<END
From: myaddr...@cox.n et
Reply-To: myaddr...@cox.n et
Return=Path: myaddr...@cox.n et
Date: $date
X-Mailer: PHP v$phpversion
MIME-Version: 1.0
Content-Type: multipart/related; boundary="$boun dary"
END;

$message = <<<END
--$boundary
Content-Type: text/plain; charset="iso-9959-1"
Content-Transfer-Encoding: 7bit

$message

--$boundary
Content-Type: octet-stream; name="$filename "
Content-Disposition: attachment; filename="$file name"
Content-Transfer-Encoding: 7bit

$csv

--$boundary--

END;

return mail( join($emails, ','), $csvName, $message, $headers );

} // func

Solved! Replaced:

Content-Type: multipart/related; boundary="$boun dary"

With:

Content-Type: multipart/mixed; boundary="$boun dary"

Peace,

JG
Mar 24 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5463
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
4
8662
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single spreadsheet attachment per message, seems to be causing som kind of corruption of the attachment, while several spreadsheets per works just fine. Consider the following three snippets of C# code:
6
2523
by: rekaeps | last post by:
We are developing an ASP.NET 2.0 (C#) application, and I'm having troubles sending e-mail from the server when accessing the web site from a separate client computer. Also, in the same scenario, I'm having trouble writing to the server's event log. Here's some details: Server and workstation both in the same workgroup Logged into server as local Administrator Logged into workstation as a local user that is only in the Users group on
0
3772
by: bambi | last post by:
I am facing issues while adding attachments in an E-mail via Mapisend. The code I use is below. If I try to send , I am getting error messgae in Mailmessage.12. Mailmessage.12 is expected as numeric, I do not know what should it be. If I Provide '0', it is throwing out error. Can any one help what shoudl I do to fix this. I am able to send E-mail sucessfully without Attachments.. Code (Please refer comments near Mailmessage.12) OPTIONS...
5
2361
by: Robert Dufour | last post by:
I am trying to use framework 1.1 - stuck with it. to send emails from a windows form application. The email messages can have attachments, usually two and they can be either text or sounds (wav files) or images (bmp, gif or tiff) I can send the email messages OK but the attachments are giving me grief. Can anyone provide some code that adds attachments to web mail messages. Thanks for any help,
1
2430
by: William Connery | last post by:
Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an e-mail with an attachment. I want to give users an indication of the percentage of the e-mail that has already been sent so as to avoid frustration when dealing with large attachments or a slow smtp server. But the smtplib module doesn't seem to...
2
2670
by: Ruud | last post by:
Just before leaving for a holiday my collegue modified this script. Now it won't send any body text (The data filled in on the form) and in an error condition it won't send any attachments either. Because I don't understand PHP I cannot find the error. Who is willing to help? regards Ruud
3
2393
by: raj200809 | last post by:
when i m sending mail i received error from symantec Antivirus" Your email message was unable to be sent because your mail server rejected the message 550-5.7.1 the ip you’re using to send mail is not authorized" i have configure smtp server put 127.0.0.1 ip in relay and also put 127.0.0.1 ip in connection. using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing;
0
37990
digicrowd
by: digicrowd | last post by:
http://bytes.com/images/howtos/applemail_sig_icon.jpg At first glance, it may not appear that Apple Mail (otherwise known as Mail.app) supports the use of HTML signature emails. However, with a little terminal and Safari magic, you will be sending HTML signatures. 1. Prepare your HTML signature. Open TextEdit or your favorite HTML editor and create your signature just how you want it to look. Remember to keep it simple as most mail...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.