RE: Newbie CGI confusion...

Discussion in 'Python' started by Robert Brewer, Feb 19, 2004.

  1. Fred Mailhot wrote:
    > I'm trying to write a script that will mail some data from a
    > web-based form
    > to me, using the "mail" command (under Linux). The following
    > illustrates the
    > crux of what I'm doing:
    > cmdstring = 'mail -c %s -s "%s" -r %s %s' % (ccaddr, subject, usrmail,
    > toaddr)


    You might want to try the SMTP module in the Library (which should be
    both more cross-platform and higher-level = easier to understand). It
    will certainly save you the command-line-quoting headaches:

    import smptlib

    server = smtplib.SMTP(serverName)
    response = server.sendmail(fromaddr, toaddrs, msg)
    server.quit()


    HTH

    FuManChu
    Robert Brewer, Feb 19, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jürgen Exner

    Re: CGI Perl "use CGI" statement fail

    Jürgen Exner, Jul 31, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,229
    Jürgen Exner
    Jul 31, 2003
  2. Shailan
    Replies:
    2
    Views:
    874
    Shailan
    Dec 15, 2003
  3. John Smith
    Replies:
    0
    Views:
    2,994
    John Smith
    May 15, 2006
  4. Fred Mailhot

    Newbie CGI confusion...

    Fred Mailhot, Feb 19, 2004, in forum: Python
    Replies:
    0
    Views:
    309
    Fred Mailhot
    Feb 19, 2004
  5. seven.reeds
    Replies:
    2
    Views:
    112
    seven.reeds
    Jun 21, 2006
Loading...

Share This Page