react-native-mailcore
react native bindings for https://github.com/MailCore/mailcore2
Stability status: alpha
Setup
-
yarn add react-native-mailcore
-
react-native link react-native-mailcore
-
For ios, setup pods for your project. Go to ios directory in your project. See https://github.com/MailCore/mailcore2/blob/master/build-mac/README.md#cocoapods
-
If you havent setup pods for your project run
pod init
in your ios directory. -
Add
pod 'mailcore2-ios'
to your Podfile. Example# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'BasicExample' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # Pods for BasicExample pod 'mailcore2-ios' target 'BasicExampleTests' do inherit! :search_paths # Pods for testing end end target 'BasicExample-tvOS' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # Pods for BasicExample-tvOS target 'BasicExample-tvOSTests' do inherit! :search_paths # Pods for testing end end
-
pod install
-
-
For android,
- copy paste the following lines in to
settings.gradle
include ':mailcore2-android-4' project(':mailcore2-android-4').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mailcore/mailcore2-android-4')
-
Add the following code to
app/build.gradle
of your app.-
For android tools version
com.android.tools.build:gradle:2.2.3
import com.android.build.gradle.internal.pipeline.TransformTask def deleteDuplicateJniFiles() { def files = fileTree("${buildDir}/intermediates/exploded-aar/com.facebook.react/react-native/0.43.3/jni/") { include "**/libgnustl_shared.so" } files.each { it.delete() } } tasks.withType(TransformTask) { pkgTask -> pkgTask.doFirst { deleteDuplicateJniFiles() } }
- Make sure to change the react-native version properly
-
For android tools version
com.android.tools.build:gradle:2.3.3
android { ... ... ... ... ... packagingOptions{ pickFirst '**/libgnustl_shared.so' } }
-
- copy paste the following lines in to
Usage
- Note: For any of the following methods you must first use loginImap
- Note: For SendMail method you must first use loginSmtp
- Note: For the use of attachments download remember to give permission to the application
;
- Login smtp
MailCore ;
- Login imap
MailCore ;
- Create Folder
MailCore ;
- List folders
MailCore ;
- Move Email
MailCore ;
- Permant Email Delete
MailCore ;
- Action Flag Message
MailCore ;
- Action label Message
MailCore ;
- Rename folder
MailCore ;
- Delete folder
MailCore ;
- List folders
MailCore ;
- Move Email
MailCore ;
- Permant Email Delete
MailCore ;
- Action Flag Message
MailCore ;
- Action label Message
MailCore ;
- Send Mail
MailCore ;
- Get mail
MailCore ;
- Get Attachment
MailCore ;
* Get Attachment Inline (Android)
* In IOS the inline attachment comes in the getmail mail method
MailCore ;
- List mails
MailCore ;}
TODO
- createFolder API support
- renameFolder API support
- deleteFolder API support
- listFolders API support
- imapLogin API support
- smtpLogin API support
- GetEmail API support
- MoveEmail API support
- DeleteEmail API support
- Download attachment
- SendEmail with attachments
- addFlags API support
- deleteFlags API support
- GetEmails API support
- Basic Example