GMail example html

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

GMail example html

Jeff Gray
I copied the example from Zodiac. Changed to my credentials and got a simple message mailed out successfully.

Then I tried changing to an html message:

| mailMessage |
mailMessage := MailMessage empty.
mailMessage setField: 'subject' toString: 'Mail Test'.
mailMessage body: (MIMEDocument
                 contentType: MIMEDocument contentTypeHtml  
                 content: '<html><body>This is test Pharo</body></html>').
ZdcSecureSMTPClient
sendUsingGMailAccount: 'myname@mydomain.com'
password: 'MyPWord01'
to: 'myothername@myotherdomain.com'
message: mailMessage.

What appeared in the email content was this:
<html><body>This is test <a href='[http://pharo.org'>Pharo</body></html]http://pharo.org'>Pharo</body></html>

Where did I go wrong?
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: GMail example html

Jeff Gray
Gah - nabble rendered my source. It was supposed to show a string with an anchor tag embedded in it :-(