Comment 2 for bug 675617

Revision history for this message
Serge (sboivin) wrote :

Humm no sure i understand what you say, because i do it with low change

add 2 optional parameter mimy_type and mime_obj

def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=None, reply_to=False,
               attach=None, openobject_id=False, ssl=False, debug=False, subtype='plain', x_headers=None, priority='3',mime_type='application',mime_obj='octet-stream'):

....
replace this line
part = MIMEBase('application', "octet-stream")
By
part = MIMEBase(mime_type, mime_obj)

nothing else need to be change, when i call the function i pass 'text' and 'calendar' and all work fine

So i dont understand why you say you need to pass attachment differently, only need to change the mime,

Anyway is not important because i duplicate the function and change it in our module.