Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #46185
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-05-27 03:01 -0700 |
| References | <20130527002229.GA12740@cskk.homeip.net> <mailman.2225.1369614504.3114.python-list@python.org> <6f870aa1-8a94-4510-a466-ca48e0605d9f@googlegroups.com> |
| Message-ID | <b78a7f7a-ae58-4697-a683-59e875552341@googlegroups.com> (permalink) |
| Subject | Re: This mail never gets delivered. Any ideas why? |
| From | Νίκος Γκρ33κ <nikos.gr33k@gmail.com> |
Finally after so many hours of try i have it working:
# =================================================================================================================
# if html form is submitted then send user mail
# =================================================================================================================
if( mailform ):
if (FROM is None) or (MESSAGE is None) or ('@' not in FROM) or ('Γράψε μου εδώ το σχόλιο σου!' in MESSAGE):
print( "<h2><font color=red>Συμπλήρωσε σωστά το mail σου και δώσε το σχολιασμό σου!</font></h2>" )
else:
maildata = FROM + '\n\n\n' + MESSAGE
sp = subprocess.Popen( ['mail', '-s', 'SuperHost Guest Mail', 'support@superhost.gr'], stdin=subprocess.PIPE )
sp.communicate( bytes( maildata, 'utf-8' ) )
status = sp.wait()
if status:
print( "<h2><font color=red>Δυστυχώς δεν μπόρεσε να αποσταλεί το e-mail :-(" )
else:
print( "<h2><font color=lime>Ευχαριστώ πολύ για το ενδιαφέρον! Θα επικοινωνήσω μαζί σου άμεσα :-)</font></h2>" )
sys.exit(0)
====================
The above worls but as sender it shows my mail and not the mail the user entred into the html box if i try to append a '-f, FROM' like the follwing:
sp = subprocess.Popen( ['mail', '-f, FROM', '-s', 'SuperHost Guest Mail', 'support@superhost.gr'], stdin=subprocess.PIPE )
then the process doenst give me an error, but doesnt also send the mail too.
Is there a way to make the mail seem as it would have come from the 'FROM' field the user entered?
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: This mail never gets delivered. Any ideas why? Cameron Simpson <cs@zip.com.au> - 2013-05-27 10:28 +1000
Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 22:00 -0700
Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 02:15 -0700
Re: This mail never gets delivered. Any ideas why? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-27 12:44 +0100
Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 03:01 -0700
csiph-web