Send Email from App

Is it possible to send via Email the Picture taken with the Camera Control? You show a send Email Icon with the example. I would like to see how it is done without using Volt

Thank You

What have you tried?

Where does it mention that you need Volt?

It doesn’t say you need volt. I just mentioned that. I can take the picture (Great Job BTW) no problem but in the example on your website it shows an Icon that says Send Email…what do I need to do to make it so I can send the picture via Email to Someone?

Great Great Great Product!

David Holt

Yeah… it’s very possible.

  1. save the captured photo somewhere you can get to it. Your options are somewhere in the camera roll and a private directory - you can also get a handle to the image in memory (I don’t remember the exact way I did this before).
  2. add the email composer plugin.
    <plugin name="cordova-plugin-email-composer" source="npm" spec="~0.8.15" />
  1. add the code to construct and send the email.
function eMail(first, last, whole, email, text)
{
  cordova.plugins.email.open({
      isHtml: true,
      to:  email,
      subject: 'My Cool Photo ',
      body:    text
  });
}

Set it as html formatted email. In the ‘text’ you can construct the email and include the image.

.

Thank you so much!

David

No worries.

I did a quick check of the plugins docs on npm and they tell you how to do this from the email. (also had a note about not using html.)

Ok thanks again.

David

I tried your solution - I put

’ <plugin name=“cordova-plugin-email-composer” source=“npm” spec=“~0.8.15” />

in the project ‘extra headers’.

It didn’t work - error says cordova is not defined. Here is the code:

'function eMail(first, last, whole, email, text)
{
cordova.plugins.email.open({
isHtml: true,
to: email,
subject: ‘My Test Email’,
body: text
});
}

Button2.onclick=function(){
eMail(“Bob”,“Smith”,“Bob Smith","myemail@gmail.com”,“hi this is a test”)

}

Thoughts?

Are you running as a PhoneGap app?

(Pro tip: enclose code with triple back ticks (```) and it will format nicely.)

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.