angelos3lex / react-native-smtp-mailer

Send emails by connecting to smtp server+attachments, using android javamail and ios mailcore2
39 stars 32 forks source link

cannot read property 'sendMail' of undefined #9

Closed KevvinG closed 5 years ago

KevvinG commented 5 years ago

I have been running into this issue. I'm quite new to react-native so I may be missing something.

I used npm to install and followed the extra steps and installed the podfile.

And of course I am importing at the top of my file

Implementation below, any help would be appreciated!

sendEmail = () => { RNSmtpMailer.sendMail({ mailhost: "smtp.gmail.com", port: "465", ssl: true, username: "circuitlab.the@gmail.com", password: "****", recipients:"kevingrzela@yahoo.com", subject:"test", htmlBody:"

"+"foo"+"

", attachmentPaths: [], attachmentNames: [], attachmentTypes: [] }) .then(success=>{ // this.setState({loading:false}); alert("Message sent successfully. We will respond you within next 2 working days. Thank you for your patience."); }) .catch(err=>{ // this.setState({loading:false}); alert("Could not send message due to some error. Please contact us through our helpline Number. "+err); }); }

dineshlt commented 4 years ago

Hi @KevvinG

I am also having to face that same issue. Why you have closed this ticket. If you have fixed it kindly help me how can I fix this issue?

weslei-dias-vakt commented 3 years ago

Same here