Re: [Pharo-users] ZdcSecureSMTPClient
Hi, On 22 Oct 2013, at 10:46, timothyageorge@gmail.com wrote:
Hello,
I tried your example for sending code thru Gmail. It works fine with ZdcSecureSMTPClient Pharo 2.0. But when I set the content to an html string. The text shows up as html (<html><body>Dear</body></html>), encoding and all but not html formatted. Ca you tell me what I'm doing wrong. Here is the code: mailMessage := MailMessage empty. mailMessage setField: 'subject' toString: 'Some subject'. mailMessage body: (MIMEDocument contentType: 'text/html' content: '<html><body>Dear</body></html>' ).
I just wrote the ZdcSecureSMTPClient subclass, I am not familiar with the finer points of MailMessage. I am guessing that for HTML content you have to work with MIME parts. I am CC-ing the pharo-users list, maybe there are people who already did this who can help you further. Regards, Sven
Hi This code works for me in Pharo 1.3. You may have some success creating a similar MailMessage object but using ZdcSecureSMTPClient as the client. emailHtml: text to: recipients from: sender subject: subject | message | message := MailMessage empty. message setField: 'from' toString: 'noreply@no.com'. message setField: 'subject' toString: subject. message addAlternativePart: text contentType: 'text/html'. SMTPClient deliverMailFrom: message from to: (self salesReportReceipients) text: message text usingServer: self smtpServer Regards Carlo On 22 Oct 2013, at 11:29 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote: Hi, On 22 Oct 2013, at 10:46, timothyageorge@gmail.com wrote:
Hello,
I tried your example for sending code thru Gmail. It works fine with ZdcSecureSMTPClient Pharo 2.0. But when I set the content to an html string. The text shows up as html (<html><body>Dear</body></html>), encoding and all but not html formatted. Ca you tell me what I'm doing wrong. Here is the code: mailMessage := MailMessage empty. mailMessage setField: 'subject' toString: 'Some subject'. mailMessage body: (MIMEDocument contentType: 'text/html' content: '<html><body>Dear</body></html>' ).
I just wrote the ZdcSecureSMTPClient subclass, I am not familiar with the finer points of MailMessage. I am guessing that for HTML content you have to work with MIME parts. I am CC-ing the pharo-users list, maybe there are people who already did this who can help you further. Regards, Sven
On Tue, Oct 22, 2013 at 11:29 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
I just wrote the ZdcSecureSMTPClient subclass, I am not familiar with the finer points of MailMessage. I am guessing that for HTML content you have to work with MIME parts. I am CC-ing the pharo-users list, maybe there are people who already did this who can help you further.
please wrote your comments there: http://stackoverflow.com/questions/19508544/smalltalk-pharo-zdcsecuresmtpcli... -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
participants (3)
-
Carlo -
Damien Cassou -
Sven Van Caekenberghe