Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo
Status: New
Owner: ----

New issue 3352 by tony.fleig: Proposal (with code) for adding  
multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

Pharo image: Pharo
Pharo core version: 1.1-11411
Virtual machine used: n/a
Class browser used (if applicable): n/a

I added the attached methods to MailMessage and modified one method in  
WAEmailMessage to allow me to create and send multipart/alternative and  
multipart/mixed email messages from Pharo/Seaside.

My need was to send text/plain and text/html multipart/alternative messages  
for account registration confirmation.

SUnit tests are included for all the new methods.

I don't know precisely how to contribute this code. I have signed no  
agreement yet. I'm hoping that by posting it the feature may find its way  
into Pharo at some point. If the code is unacceptable for some reason, I am  
willing to make whatever changes are needed.

Example using the new functionality:


| msg ssmsg |

msg := TFMailMessage empty.
msg
     addAlternativePart: 'This is plain text.'
         contentType: 'text/plain';
     addAlternativePart: '<html><head></head><body>This is  
html.</body></html>'
         contentType: 'text/html'.

ssmsg := msg
     seasideMailMessageFrom: '[hidden email]'
     to: '[hidden email]'
     subject: 'Test multipart message'.

ssmsg plainMessage.

Produces:

'From: [hidden email]
To: [hidden email]
Subject: Test multipart message
Date: Sun, 28 Nov 2010 12:46:18 -0800
content-type: multipart/alternative;boundary="==CelesteAttachment50460=="
mime-version: 1.0



--==CelesteAttachment50460==
Content-type: text/plain

This is plain text.
--==CelesteAttachment50460==
Content-type: text/html

<html><head></head><body>This is html.</body></html>
--==CelesteAttachment50460==--
'


Attachments:
        MailMessage-addAlternativePart.st  257 bytes
        MailMessage-seasideMailMessageFromtosubject.st  578 bytes
        MailMessage-makeMultipartwith.st  888 bytes
        WAStringEmailBodyTest-testMultipart.st  1.4 KB
        MailMessage-addPartcontentType.st  446 bytes
        MailMessage-addMixedPartcontentType.st  456 bytes
        MailMessage-addAlternativePartcontentType.st  468 bytes
        MailMessage-addMixedPart.st  243 bytes


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo

Comment #1 on issue 3352 by tony.fleig: Proposal (with code) for adding  
multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

Error in example: TFMailMessage should be MailMessage.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo

Comment #2 on issue 3352 by tony.fleig: Proposal (with code) for adding  
multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

Forgot one file: The MailMessage test.

Attachments:
        MailMessageTest-testMultiPartAlternative.st  953 bytes


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo

Comment #3 on issue 3352 by tony.fleig: Proposal (with code) for adding  
multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

Oops. This is getting embarrassing. Forgot another file: The  
multipart/mixed test.

Attachments:
        MailMessageTest-testMultiPartMixed.st  929 bytes


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo
Updates:
        Status: Fixed

Comment #4 on issue 3352 by stephane.ducasse: Proposal (with code) for  
adding multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

no stress.
By the way pay attention that WA is for seaside.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo

Comment #5 on issue 3352 by tony.fleig: Proposal (with code) for adding  
multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

Right. I wan't sure how a change in Seaside (in WAEmailMessage) that  
depends on a change in Pharo (in MailMessage) should be handled. I was  
thinking that the Pharo change should happen first and then the Seaside  
change?


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo

Comment #6 on issue 3352 by tony.fleig: Proposal (with code) for adding  
multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

Replacing file MailMessage-seasideMailMessageFromtosubject.st with a  
version that does not reference my temporary test class.

Attachments:
        MailMessage-seasideMailMessageFromtosubject.st  571 bytes


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo
Updates:
        Labels: Type-RequestForEnhancement

Comment #7 on issue 3352 by adrian.lienhard: Proposal (with code) for  
adding multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

Hi Tony,

Thanks for the contribution. Improvements like this are very much  
appreciated.

We have a (somewhat complicated) description of the contribution process at  
http://code.google.com/p/pharo/wiki/HowToContribute.

The most important thing is if you could sign the agreement (linked from  
the above mentioned page).

Changesets are OK, but you could also submit your code with Monticello.

Adrian


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo

Comment #8 on issue 3352 by tony.fleig: Proposal (with code) for adding  
multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

After reading the HowToContribute document, I think maybe I should just  
start over with submitting this. I have signed the agreement and will fax  
it tomorrow. Then I will follow the HowToContribute instructions and submit  
the Pharo changes via PharoInBox and deal with the Seaside changes  
separately.

Is there a way to retract this issue at this point so I can do it properly?


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3352 in pharo: Proposal (with code) for adding multipart/alternative MIME support to MailMessage and WAEmailMessage

pharo
Updates:
        Status: Closed

Comment #9 on issue 3352 by stephane.ducasse: Proposal (with code) for  
adding multipart/alternative MIME support to MailMessage and WAEmailMessage
http://code.google.com/p/pharo/issues/detail?id=3352

no stress :)
we can simply close it!