[Tutor] email content-type: text/plain

shawn bright nephish at gmail.com
Thu Nov 16 22:57:03 CET 2006


use  MIMEText(message, 'someTypeThatIsn'tPlain')  ? but type/plain is what i
am after.
i am a bit confused here. It defaults to plain, but there is not anything in
the message headers that say what type it is. Should i use MIMEText(message,
'text/plain') ?

thanks
sk

On 11/16/06, Chris Hengge <pyro9219 at gmail.com> wrote:
>
> Not sure if I'm really helping, but I want to try for all the help I've
> gotten...
> I took this from: http://docs.python.org/lib/module-email.message.html
>
> ##############################################################################
> *class  MIMEText*( _text[, _subtype[, _charset]]) Module: email.mime.text
>
> A subclass of MIMENonMultipart, the MIMEText class is used to create MIME
> objects of major type text. _text is the string for the payload. _subtypeis the minor type and defaults to
> plain. _charset is the character set of the text and is passed as a
> parameter to the MIMENonMultipart constructor; it defaults to us-ascii. No
> guessing or encoding is performed on the text data.
>
>
> #############################################################################
>
> Going off this, I'd say you need to change:
>
> msg = MIMEText(message)
>
> to:
>
> msg = MIMEText(message, 'someTypeThatIsn'tPlain')
> On 11/16/06, shawn bright <nephish at gmail.com> wrote:
> >
> > hey there all,
> > i am using the email package and the phone provider i am trying to get a
> > text message thru has sent me an email that says that they are looking for a
> > tag that says 'content-type text/plain'
> >
> > i have tried about everything i can think of to get it in there, but
> > everything i have tried has failed.
> >
> > here is what i have so far:
> > address = 'someplace at someplace.com'
> > message = 'some text that needs to be delivered via text message'
> > msg = MIMEText(message)
> > msg['Subject'] = 'pivots'
> > msg['From'] = 'l11 at xit.net'
> > msg['To'] = address
> > server.sendmail(msg['From'],msg['To'], msg.as_string())
> >
> > any ideas ?
> > thanks
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061116/eb82ab5c/attachment.html 


More information about the Tutor mailing list