On Thu, 7 May 2009 15:20:12 +0530, ganesh gunasekaran <[email protected]> 
wrote:
>Hi gp,
>I'm very new to Twisted Framework ,
>I wrote a very simple  code to send mails concurrently, using SMTP mail
>server
>the code as below
>
>
>from twisted.mail.smtp import sendmail
>from twisted.internet import reactor
>from twisted.python.log import err
>import time
>
>MAILSERVER = 'mail.xxx.com'
>listTo = ['[email protected]', '[email protected]', '
>[email protected]']
>FROM = '[email protected]'
>MSGBODY = "hi this is test mail"
>a= time.time()
>done = sendmail(MAILSERVER, FROM, listTo, MSGBODY ,senderDomainName=None,
>port=25)
>done.addErrback(err)
>done.addCallback(lambda ignored: reactor.stop())
>reactor.run()
>print "Took %s seconds" %str(time.time()-a)
>
>
>hence i'm not aware of how to authenticate my mail server in Twisted
>Framework ,this code gives me error saying ,"Relay access denied"
>I will be grateful  if someone forward me the right solution.

`sendmail´ can't be used to authenticate.  For that, you need to use
`ESMTPSenderFactory`.  It takes many of the same arguments as `sendmail´,
plus a `username´ and `password´ and some options related to security.

If you haven't worked with factories before, the client howto might be
helpful:

http://twistedmatrix.com/projects/core/documentation/howto/clients.html

Jean-Paul

_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to