You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using react-native-mailcore library to reply mail. As per the instruction on that library doc, i am doing smtp login before calling MailCore.sendMail. From second time reply mail is working fine with same code as well as For compose mail i am using same code to send mail. It is working fine for that case also. My code is given bellow.
import MailCore from 'react-native-mailcore';
var LocalStorage = require('react-native-local-storage');
sendMail = async () => {
let user = await LocalStorage.get('user');
await MailCore.loginSmtp({
hostname: 'smtp.gmail.com',
port: 465,
username: user.email,
password: user.password,
}).catch(error => ToastAndroid.show(error,ToastAndroid.LONG))
// All the values from the state are coming correctly
let subject = this.state.subject || '(No Subject)';
let body = this.state.compose + this.state.body || '';
let from = {
addressWithDisplayName : this.state.name,
mailbox: this.state.user,
}
let to = {[this.state.to] : 'to labels'};
// App crashed here while called sendMail
await MailCore.sendMail({
headers:{
isEncrypted: 'true',
},
from:from,
to:to,
subject:subject,
body,
}).then(()=>{
this.goBack(); //navigating to main page after success
ToastAndroid.show("sending...",ToastAndroid.SHORT);
}).catch(err => ToastAndroid.show(err,ToastAndroid.LONG));
}
The text was updated successfully, but these errors were encountered:
0
I am using react-native-mailcore library to reply mail. As per the instruction on that library doc, i am doing smtp login before calling MailCore.sendMail. From second time reply mail is working fine with same code as well as For compose mail i am using same code to send mail. It is working fine for that case also. My code is given bellow.
import MailCore from 'react-native-mailcore';
var LocalStorage = require('react-native-local-storage');
sendMail = async () => {
let user = await LocalStorage.get('user');
await MailCore.loginSmtp({
hostname: 'smtp.gmail.com',
port: 465,
username: user.email,
password: user.password,
}).catch(error => ToastAndroid.show(error,ToastAndroid.LONG))
// All the values from the state are coming correctly
let subject = this.state.subject || '(No Subject)';
let body = this.state.compose + this.state.body || '';
let from = {
addressWithDisplayName : this.state.name,
mailbox: this.state.user,
}
let to = {[this.state.to] : 'to labels'};
}
The text was updated successfully, but these errors were encountered: