How to send an anonymous mail via Python script

Νίκος nikos.gr33k at gmail.com
Sat Sep 21 05:58:21 EDT 2013


I'll have to ask this atgain because i got no proper reply:
Here is the code i wrote to try tos end anonymous mail:

# 
=================================================================================================================
# if html form is submitted then send user mail
# 
=================================================================================================================
def random_char( y, chars=string.ascii_uppercase + string.digits ):
	return ''.join( random.choice(chars) for x in range(y) )


for times in range(0, 5):
	try:
		# prepare mail data
		FROM = random_char(8) + '@' + 'mail' + '.org'
		TO = "nikos.gr33k at gmail.com"
			
		SUBJECT = random_char( 50 )
		MESSAGE = random_char( 500 )
		
		os.system( "echo %s | mailx -v -r %s -s %s %s" % (MESSAGE, FROM, 
SUBJECT, TO) )

		print( "<h2><font color=blue>%sη αποστολή προς %s 
επετεύχθη!</font></h2>" % (times, TO) )
	except Exception as e:
		print( "sendmail => ", date, repr( sys.exc_info() ) )
else:
	print( '''<h2><font color=red>Δεν επιτρέπεται η χρήση του script από μη 
εξουσιοδοτημένα πρόσωπα!''' )

sys.exit(0)
=========================================================================================================================

Can you please tell me what alternation must be made in order to send 
this anonymously?

that is my question. There must be a way.

1. either by python and its smtplib module
2. by configuring the local MTA
3. by using a remailer

Please provide a solution with code if possible.
I will only answer to serious replies.



More information about the Python-list mailing list