PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
attachment in body of the mail

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
didine8085



Joined: 02 Oct 2009
Posts: 1

PostPosted: Fri Oct 02, 2009 3:16 pm    Post subject: attachment in body of the mail Reply with quote

Hello

I have made code to send mail with an attachment, the mail is sent but the attachment is in the body of mail and the result is like this :

--=_214bfa3123286fc53cf1f7d8266ef346
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="ISO-8859-1"

<html>
<head>
<style>body{font: 13px Arial;}
</style></head>
<body><font size=3D'4'>Newsletter 1 newsletter test </font><br/><font size= =3D'5' color=3D'#006699'> Num=E9ro 10</font><br/><br/>gdgdgdf d dgfgdfgd dg= f dfg<br/><br/><BR/><BR/><hr/>


</body>


--=_214bfa3123286fc53cf1f7d8266ef346
Content-Transfer-Encoding: base64
Content-Type: text/plain;
name="fichier_texte.txt";
Content-Disposition: attachment;
filename="fichier_texte.txt";

dGVzdA==
--=_214bfa3123286fc53cf1f7d8266ef346--

If i send a mail without attachment, there is no problem.

The problem doesn't came by a configuration of php ?

Thank you for your help
Back to top
View user's profile Send private message
controls



Joined: 16 Feb 2010
Posts: 1

PostPosted: Tue Feb 16, 2010 11:19 am    Post subject: Reply with quote

The idea is that you create a Body for the attachment s nice one.
_________________
gamblingstrategyandtips.com
Back to top
View user's profile Send private message
brennanw



Joined: 20 May 2010
Posts: 8

PostPosted: Thu May 20, 2010 11:23 pm    Post subject: Reply with quote

I'm having the exact same issue. My code works fine on an older version of php, pear mail, and pear mail_mime. However, on a new server that I'm configuring, the exact same code running against the latest version of php, pear mail, and pear mail_mime gives me errors. I'm getting my attachments stuffed into the message body and the body is also getting = signs in what appear to be random places. It's all very frustrating.
Back to top
View user's profile Send private message
brennanw



Joined: 20 May 2010
Posts: 8

PostPosted: Fri May 21, 2010 1:19 am    Post subject: Reply with quote

I found the solution to this problem (at least for my case). I was reading through the changes that were included in the versions of mail_mime since the last time I upgraded and I noticed that version 1.7.0 (the version I'm running now) included a new function called setContentType(). The text included with this release states "Added Mail_mime::setContentType() function with possibility to set various types in Content-Type header (also fixes problem with boundary parameter when Content-Type header was specified by user)". Well, I reviewed my code and noticed that I have been passing a content-type in my $headers array. So, I removed the content-type from the $headers array and it fixed the problem. The attachments are now coming through as they should.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement