Trying to utilize mailx to send mail via apython script

Discussion in 'Linux Networking' started by Ferrous Cranus, Sep 5, 2013.

  1. Ferrous Cranus

    Whiskers Guest

    Might be useful to clarify whether the OP wants the visitor's message to
    be sent *to* the OP's Gmail address, eg as feedback from a website, or
    wants the visitor to be able to send emails to anyone by *relaying*
    through Google's SMTP server using the OP's Google account but with
    unspecified or invented 'From' addresses.

    The latter should not be permitted by Google or any other email service
    provider, of course.

    <http://www.nixtutor.com/linux/send-mail-with-gmail-and-ssmtp/>
    <https://wiki.archlinux.org/index.php/SSMTP#Forward_to_a_Gmail_Mail_Server>
    <http://heirloom.sourceforge.net/mailx.html>
     
    Whiskers, Sep 10, 2013
    #41
    1. Advertisements

  2. Στις 10/9/2013 6:38 μμ, ο/η Whiskers έγÏαψε:
    What i want is for my weboage to notify me for the visitors spcified
    mail address and message and this be done by setting up my won mail
    server because gmail's tend to alter the from address.
     
    Ferrous Cranus, Sep 10, 2013
    #42
    1. Advertisements

  3. Ferrous Cranus

    David Brown Guest

    Your own email server will either send via another "real" SMTP server,
    such as gmail's (which will change the Sender and/or From fields), or it
    will try to deliver email directly - in which case half the receiving
    email servers will block it as a spam server (even if you go to all the
    effort of fixed IP's, proper DNS, and proper reverse DNS, you will be
    caught sending with From addresses that should not be coming from your
    machine).

    I don't know why this is so difficult for you to comprehend - you cannot
    forge other people's From addresses and expect everything to work!

    Just implement the web site in the same way everybody else does - fields
    that the user enters (such as their own address) go as part of the email
    contents, and the whole thing is emailed to a fixed address from a fixed
    address (these can even be the same, such as your gmail address).

    This is not rocket science - people have been doing it correctly for a
    long time. The reason you are having such a hard time is because you
    are desperately trying to misunderstand how email works, and how web
    email forms work.

    <http://www.freecontactform.com/html_form.php>
    <http://www.templatemonster.com/help/how-create-contact-form-html.html>

    (These use php rather than python, but the principle is the same.)
     
    David Brown, Sep 10, 2013
    #43
  4. Ferrous Cranus

    Whiskers Guest

    Your web page cannot send an email 'From:' the visitor's email address.
    It has to send emails 'From' an address which you own and using an SMTP
    server associated with that email address.

    If you want to know the visitor's email address, design the form to
    include that as part of the 'body' of the email message the web page
    sends to you (or perhaps as the 'Reply-To:' header of that message).

    <https://ixquick.com/do/search?q=how+to+send+email+from+web+form>

    Checking whether or not the visitor has given a real email address, is a
    separate matter.
     
    Whiskers, Sep 10, 2013
    #44
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.