473,507 Members | 2,443 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.csv";
$headers = <<<END
From: my*******@cox.net
Reply-To: my*******@cox.net
Return=Path: my*******@cox.net
Date: $date
X-Mailer: PHP v$phpversion
MIME-Version: 1.0
Content-Type: multipart/related; boundary="$boundary"
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="$filename"
Content-Transfer-Encoding: 7bit

$csv

--$boundary--

END;

return mail( join($emails, ','), $csvName, $message, $headers );
} // func
Mar 24 '08 #1
1 2388
On Mar 24, 1:42 pm, jerrygarciuh <jerrygarc...@gmail.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.csv";
$headers = <<<END
From: myaddr...@cox.net
Reply-To: myaddr...@cox.net
Return=Path: myaddr...@cox.net
Date: $date
X-Mailer: PHP v$phpversion
MIME-Version: 1.0
Content-Type: multipart/related; boundary="$boundary"
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="$filename"
Content-Transfer-Encoding: 7bit

$csv

--$boundary--

END;

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

} // func

Solved! Replaced:

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

With:

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

Peace,

JG
Mar 24 '08 #2

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

Similar topics

8
5451
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 -------------------------------------------------------------------------------- ...
4
8641
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...
6
2506
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,...
0
3766
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,...
5
2355
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...
1
2406
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...
2
2660
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....
3
2386
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...
0
37972
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...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
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...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5045
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
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 ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.