1. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Rep Power

    Question Trying to send mail form within my python script via mailx

    i as root just inatslled

    sendmail and mailx. i have edited the ~/.mailrc to use:

    nikos@superhost.gr [~/www/cgi-bin]# cat ~/.mailrc
    account gmail {
    set smtp-use-starttls
    set smtp=smtp://smtp.gmail.com:587
    set smtp-auth=login
    set smtp-auth-user=may)gmail
    set smtp-auth-password=my_gmail_password

    And now i'm trying to:

    include subprocess
    cmd = "echo %s | mailx -A gmail -r %s -s %s %s"  %  (MESSAGE, FROM, SUBJECT, TO)
    p=subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE )
    output, errors = p.communicate()
    print( errors, output )

    Any ideas please why this fails to work?
    while i remove the '-A gmail' string in the cmd line then i can send fast mail but only to mail containing the @superhost.gr trail.

    i need to be able to send to external mails to.

    this is the error message:

    Missing "nss-config-dir" variable.
    . . . message not sent.
    Last edited by Nik; September 5th, 2013 at 09:03 AM.

IMN logo majestic logo threadwatch logo seochat tools logo