I've also tried to use MIME to encode both the html, and an alternative text/html message, however all the encoding goes after the double newline and is not interpreted as an header.
so Yarko are you saying that by doing send(message='hello message') instead of send(to=['m...@me.com'], message='hello message') it should worrk by including the correct headers in the message? On 10 Lug, 22:15, mdipierro <mdipie...@cs.depaul.edu> wrote: > While this can be and something like this can be added it is my > understanding that you do not need to change the header to send html > emails. You need to use the MIME encoding and that should be > transparent to what mail.send does now. If I am wrong please provide > an example of how to change the headers to send a MIME encoded > message. > > On Jul 10, 1:31 pm, kralin <andrea.pierle...@gmail.com> wrote: > > > I spent the whole afternoon trying to send an HTML formatted email > > with web2py. > > while I cannote use smtplib directly, cause it seems not to work, and > > I think this should be "normal" in the framework. > > however in the current release (Version 1.65.0 (2009-07-01 12:16:25)) > > it is not possible to alter the content-type, or any other header for > > the email using the gluon.tools.Mail class. > > this happens because anu message that is passed to the mail=Mail() > > object is attached to this string before beeing sent: > > > msg = '''From: %s\r > > To: %s\r > > Subject: %s\r > > \r > > %s'''\ > > > and the double newlines close the headers. > > > so it would be very useful to also set at least something link this: > > > def send( > > self, > > to, > > subject='None', > > message='None', > > headers='\r\n' > > ): > > > msg = '''From: %s\r > > To: %s\r > > Subject: %s\r > > \r > > %s'''\ > > % (self.settings.sender, ', '.join(to), > > subject,headers, > > message) > > > so that it will be possible to pass directly some header strings or > > pass an empty string as headers, and put them in the message. > > this way they can be correctly recognized. > > > hope this helps > > cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---