If you are using MAC, you can create epub file with Pages.
You can export any Pages word processing document to the ePub file format for reading in an ePub reader.
If you have plain text, you can easily create your ebook by using epub file example.
You can download the “ePub Best Practices” sample document at the following web address:
Read more detail at Apple website.
However if you are planning to create epub file with many images (especially large photos) pages will not give satisfying result. You may use iBooks Author to create the file. However be aware the ebook will not be epub format, it will be ibooks format and you can only read in iPad or iPhone.
Alternatively you can use Adobe InDesign or StoryMill.
As you know epub files can be read on portable e-ink devices, mobile phones, tablets, iPad, iPhone and desktop computers.
If you are familiar with HTML you can create epub file by creating XML, CSS, and XHTM files and zip them.
Checking Your ePub file
If you create a sample ePub book, and it won’t open, or it opens with an error, or you want to make sure these files work correctly then you need to check the epub file.
To do so you can use epubcheck.
It is a program that will scan your ePub file and display any errors it finds in the book.
You can download it here
On a Mac, you can change the file’s extension from .epub to .zip and then extract the contents of the ZIP archive. Then you may use the command line in Terminal to create the ZIP archive or use EpubCheck.