New QEmailServer with File Attachments

thread: 12 messages  |  last: about 5 years ago  |  started: wednesday, july 25, 2007, 8:34 pm pdt


#1  |  Chris Peterson (Seattle, WA) United States of America Qcodo Core Contributor
Wednesday, July 25, 2007, 8:34 PM PDT

Hey Everyone,  

I added support for file attachments to QEmailServer and posted the files with instructions in downloads.

<http://www.qcodo.com/downloads/item.php/135>

I haven't tested on windows yet so let me know.  I submitted this to Mike for inclusion into the core, but not sure when the next release will be.  So test away and let us know if there are any major problems.

#2  |  alex94040 (Seattle, WA) United States of America Qcodo Core Contributor
Tuesday, July 31, 2007, 5:59 PM PDT

Chris, thanks a lot for working on the QEmail server! It's awesome!

One request - is there any chance you can make it work with GMail? I love their “apps for your domain”, but QEmailServer currently doesn't support it. Relevant thread: http://www.qcodo.com/forums/topic.php/2131/1//?strSearch=gmail

Can you by any chance take on this feature request, please?

#3  |  Chris Peterson (Seattle, WA) United States of America Qcodo Core Contributor
Tuesday, July 31, 2007, 8:10 PM PDT

Hey Alex,

That is a pretty large request =)  I don't know that much about SSL other than installing a certificate on a webserver, but some quick searching, found there are multiple ways to encrypt a message, OpenSSL, PGP, and others.  i am not sure which one would work for all situations or which is the best.  Any ideas on what is most commonly used?  I found this article on Zends site that talks about PGP.  
<http://devzone.zend.com/node/view/id/1265#Heading5>

if you look at the stuff i just added, it does base64encoding, so theoretically you could use there shell_exec function to launch gpg and encrypt the message stuff.

Should it use a built-in php function as a requirement?  php.net has some info on encrypting/decrypting/signing messages in their OpenSSL stuff.  

All the PGP stuff with PHP seems to require command line or extra utilities, which goes against the QCodo not using outside packages.  

if you can point me to some documentation or example code on how to implement it that would be cross system compatible and work for all of the major email clients i will look at it.  

I am pretty swamped right now, and email attachments was a need I had, so I added it while working on that.  I don't have a need for SSL right now, so it probably wont be high priority, but i am pretty familiar with the QEmailServer code right now, so if you find something that wouldn't be too much extra work, I would take a look.

I would think that QEmailServer, would need to accept a private key to encrypt the message with and it would need a special port to talk with.  

sorry i couldn't be much more help. if you find more info let me know.

#4  |  alex94040 (Seattle, WA) United States of America Qcodo Core Contributor
Tuesday, July 31, 2007, 8:25 PM PDT

Here's what I ended up using - maybe there's an elegant way to integrate the logic this guy put together into QEmailServer -

http://www.vulgarisoip.com/2006/10/13/update-send-email-with-php-and-gmail-hosted-for-your-domain/

It works well on both Windows and Linux, and makes no system utility calls.

#5  |  Chris Peterson (Seattle, WA) United States of America Qcodo Core Contributor
Tuesday, July 31, 2007, 10:30 PM PDT

Hey Alex,

Thanks for the info.. that definitely helped a lot. if you have OpenSSL compiled in your PHP on windows or linux, which you probably do =)  Just adding that for other readers... then you can use Gmail's SSL stuff with the following settings...  

// add to your code above the Send and it should work!
    QEmailServer::$SmtpServer = 'sslv2://smtp.gmail.com';
    QEmailServer::$SmtpPort = 465;
    QEmailServer::$SmtpUsername = 'username@gmail.com';
    QEmailServer::$SmtpPassword = '*****';
    QEmailServer::$AuthLogin = true;

let me know how it works for you. i just tested it and it works out of the box. =)

#6  |  alex94040 (Seattle, WA) United States of America Qcodo Core Contributor
Wednesday, August 1, 2007, 2:50 PM PDT

Thanks, Chris! I'll give it a shot (a tad swamped at the moment, but when I do, I'll definitely report back). Thanks!!

#7  |  alex94040 (Seattle, WA) United States of America Qcodo Core Contributor
Friday, August 10, 2007, 1:45 PM PDT

Works like a charm! Thanks a bunch! So glad to see QEmailServer working with Gmail! You rock!

#8  |  David M. Clark (Berwick, PA) United States of America Financial Contributor
Tuesday, February 12, 2008, 5:31 PM PST

Hi Chris.

I have been trying to get your version of QEmailServer to work.  When I attach a PDF or other type file I get the encoded file included in the Text version of the message.  it does not come as an attachement and it also prevents the BodyHtml from being displayed.  

What seems to be happening is that it considers everything to be a text message including the encoded PDF file.  

This particular application is running with Qcodo 3.24.

Anything you can suggest?

David

#9  |  Chris Peterson (Seattle, WA) United States of America Qcodo Core Contributor
Tuesday, February 12, 2008, 10:01 PM PST

Hey David,

Try grabbing the latest QEmailServer.class.php from the 3.42 build.  I think I had submitted a few patches and then Mike had cleaned it up.  I am not sure if the downloads section had my latest copy.  Try that and let me know.  

If that still doesn't work give me a little more info on the situation, i.e. Email client you are viewing in, and some of the basic code to reproduce the problem. Also does it happen with all PDF files and any type of test text or does it happen only with a particular HTML attachment code.  Make sure there are no weird characters in the text/html message when testing...  Also if you can duplicate it with some public test data and want to send me a copy of the email, I can look at the header and see what is going on.

Chris

#10  |  David M. Clark (Berwick, PA) United States of America Financial Contributor
Wednesday, February 13, 2008, 5:59 PM PST

Hi Chris.

Thanks for your reply.

I move the 3.42 QEmailServer.class.php to the system and I noticed that there was also a QMimeType.class.php so I moved it also.  (both into the Framework Director)

With your system the attachment was created with the following command:

$objMessage->Attach('../documents/test.pdf', QFileMimeType::PDF, 'test.pdf');

Of course when I ran that I got a QFileMimeType not found.  So I changed it to

$objMessage->Attach('../documents/test.pdf',QMimeType::Pdf, 'test.pdf);

I got a similar result   “QMimeType not found.

I have looked at the examples and the API and can not find what the Command is to create the attachment with the new QEmailServer.  

Help again!!

David



Copyright © 2005 - 2013, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.