C# Class Summer.Batch.Extra.EmailSupport.EmailTasklet

Tasklet for sending emails. The host, from, subject and body fields are mandatory. The body is read from a resource. At least one recipient should be specified (in to, cc, or bcc).
Inheritance: ITasklet, IInitializationPostOperations
Show file Open project: SummerBatch/SummerBatch Class Usage Examples

Public Methods

Method Description
AfterPropertiesSet ( ) : void

@see IInitializationPostOperations#AfterPropertiesSet

DoExecute ( ) : bool

Inner execute.

Execute ( Summer.Batch.Core.StepContribution contribution, Summer.Batch.Core.Scope.Context.ChunkContext chunkContext ) : RepeatStatus

Send the mail message given all needed information. @see ITasklet#Execute

Private Methods

Method Description
CreateMailMessage ( ) : MailMessage

Create mail message

GetLines ( StreamReader reader ) : string

Read mail body, line by line of the specified LineLength size.

GetText ( ) : string

Read mail body from given file

SetupSmtpClient ( ) : SmtpClient

Setup smtp client

Method Details

AfterPropertiesSet() public method

@see IInitializationPostOperations#AfterPropertiesSet
public AfterPropertiesSet ( ) : void
return void

DoExecute() public method

Inner execute.
public DoExecute ( ) : bool
return bool

Execute() public method

Send the mail message given all needed information. @see ITasklet#Execute
 
public Execute ( Summer.Batch.Core.StepContribution contribution, Summer.Batch.Core.Scope.Context.ChunkContext chunkContext ) : RepeatStatus
contribution Summer.Batch.Core.StepContribution
chunkContext Summer.Batch.Core.Scope.Context.ChunkContext
return RepeatStatus