I guess you can use smtplib. On Fri, Mar 26, 2010 at 7:07 PM, Timo <timomli...@gmail.com> wrote:
> > > 2010/3/25 Timo <timomli...@gmail.com> > > Hello, >> >> I was wondering what the best way is to send an email through my program? >> I want the user to send an email with an attachment. >> >> I do have a webspace, should I use the smtplib module if my webhost >> supports it (I have to ask though), or should I put a script on my space and >> communicate with that? >> >> Cheers, >> Timo >> > > > I worked on the following code. It works, but not for attachments. > > On the webserver I have: http://python.pastebin.com/9m8MXxuR > > And inside my program I then do: > form = urllib.urlencode([("from", send_from), ("to", send_to), ("subject", > subject), ("body", body), ("attachment", attachment)]) > webbrowser.open(url + "?" + form) > > > So, 2 questions: > - Is this a good way of sending mails over my webhost through my program? > - Attachments don't work because I'm sending the path to the file, and > ofcourse the cgi script can't find it. How should I solve this? > > Cheers, > Timo > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor