#NEWLINE# def sendmail( self , sender , recipient , msg ) : #NEWLINE# #INDENT# '\n        Mock sendmail method\n        ' #NEWLINE# if ( self . flag == 1 ) : #NEWLINE# #INDENT# raise SMTPRecipientsRefused ( 'All recipients were refused.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . flag == 2 ) : #NEWLINE# #INDENT# raise SMTPHeloError ( 'Helo error' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . flag == 3 ) : #NEWLINE# #INDENT# raise SMTPSenderRefused ( 'Sender Refused' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . flag == 4 ) : #NEWLINE# #INDENT# raise SMTPDataError ( 'Data error' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ( sender , recipient , msg )