EasySwift and the default encoding

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
andr3a
Forum Newbie
Posts: 3
Joined: Mon Feb 18, 2008 7:53 am

EasySwift and the default encoding

Post by andr3a »

Hi there,

first of all thank you for Swift Mailer, it seems to be a good project, really.

I am here just to report a bug in last release, exactely in file EasySwift and line 739.

Since 3 lines before you wrote
* @param string The encoding used (default is base64)

I think you should change the default null value from parameter $encoding and method addAttachment.

It is just because if someone is using this great wrapper for old Swift version and he doesn't add base64 encoding this wrapper will send a new Swift_Message_Attachment($data, $filename, $type, $encoding), with null value.

I am not sure the problem I had with PDF was there, anyway this is just a little doc or code problem that you could easily solve, changing the comment or using $encoding="base64" as default, as is in Swift_Message_Attachment constructor.

Cheers,
Andrea Giammarchi
andr3a
Forum Newbie
Posts: 3
Joined: Mon Feb 18, 2008 7:53 am

Re: EasySwift and the default encoding

Post by andr3a »

I would like tell you that I solved EasySwift attachment problems sending manually base64, as last encoding parameter.

This is just to confirm that you can easily fix this little bug changing EasySwift file, in line 739, this method declaration:

Code: Select all

public function addAttachment($data, $filename=null, $type="application/octet-stream", $encoding=null)
with this one

Code: Select all

public function addAttachment($data, $filename=null, $type="application/octet-stream", $encoding='base64')
Kind Regards
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: EasySwift and the default encoding

Post by Chris Corbyn »

Eek! I didn't even realise that class was still there. I should have deprecated this ages ago ;) Surprised it even still works at all :P
andr3a
Forum Newbie
Posts: 3
Joined: Mon Feb 18, 2008 7:53 am

Re: EasySwift and the default encoding

Post by andr3a »

Its only a Wrapper, but it is working perfectly.
So please do not remove them from your next release :D

Cheers,
Andrea
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: EasySwift and the default encoding

Post by Chris Corbyn »

andr3a wrote:Its only a Wrapper, but it is working perfectly.
So please do not remove them from your next release :D

Cheers,
Andrea
I'm afraid it will definitely be gone in next release. EasySwift is a v2 wrapper. Th next release is going to be v4 and I simply can't maintain something two versions old ;)
Post Reply