Does Python have a module to convert CSS styles to inline styles for emails?

前端 未结 4 984
陌清茗
陌清茗 2020-12-28 09:07

I know this exists in other languages, but I want it for Python to I can send emails that\'ll show up in GMail, etc.

4条回答
  •  半阙折子戏
    2020-12-28 09:35

    toronado is Fast lxml-based CSS stylesheet inliner.

    Installation : pip install toronado

    Example :

    import toronado
    document = """
    
       
    
    

    Hello, world.

    """ print(toronado.from_string(document))

提交回复
热议问题