[android-developers] Re: sending email ?

2012-09-17 Thread bob
 

I would say create a PHP script for sending mail on your web server.  Then 
do an HTTP load of the script in the background.



On Sunday, September 16, 2012 6:24:19 AM UTC-5, mohammed Nuhail wrote:

 how to send email in background ?


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: sending email automatically

2011-10-09 Thread scame
Не совсем понял, что ты именно хочешь. Чтобы тебе автоматически письмо 
отсылалось по какому-то интервалу? Создай сервис, запусти в нём поток и по 
таймеру хреначь. Или я не понял.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: sending email automatically

2011-10-09 Thread lbendlin
If you didn't understand what he/she wanted, then why bother replying?  The 
usage of a service is not relevant to the stated problem.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Sending EMAIL

2010-08-20 Thread FrankG


 The email address that I pass via:
         sendIntent.putExtra(Intent.EXTRA_EMAIL, theem...@comcast.net);
 is always ignored and so it has to be manually entered on each email.

 Any solution? Thanks in advance.

Try this :

private static final String YOURTO = m...@medomain.com;
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { YOURTO });


Good luck !

  Frank

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Sending email by Intent... not simply composing a message

2010-08-11 Thread DulcetTone
You're right... I misstated that.  I can send SMS messages using the
SDK, but cannot send email.
I find that incongruous, despite the fact that the email app in the
open source contains some nicely crafted code to do just that.

Is every app that is to send mail to reinvent a very intricate, heavy
wheel?  I guess I have a feature request to line up.

tone

On Aug 11, 2:42 pm, Mark Murphy mmur...@commonsware.com wrote:

 Well, SMS-by-Intent does not cause it to be sent, either. If you are
 looking for an analogue to SmsManager for sending emails, there is
 none -- sorry!


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Sending email by Intent... not simply composing a message

2010-08-11 Thread Sarwar Erfan


On Aug 12, 2:13 am, DulcetTone dulcett...@gmail.com wrote:
 You're right... I misstated that.  I can send SMS messages using the
 SDK, but cannot send email.
 I find that incongruous, despite the fact that the email app in the
 open source contains some nicely crafted code to do just that.

Why do you find it incongruous?

For sending SMS:
Your device actually DOES NOT send the SMS to the other party. It
sends to a server (known as SMSC). Then the server pushes the SMS to
the other party.
Now, who runs SMSC and how is your phone aware of it? The answer is
simple (and obvious) --- the mobile operator runs the server for you.
And, they have the SMSC number stored in the SIM card you entered in
the phone. So, to send an SMS, you do not need to have anything extra,
your phone subscription plan comes with built in SMS service (i.e.
address and permission to use SMS server). So, there is an SmsManager
in Android and you can send SMS through without any need to know how
it is being sent to the other party.

For sending Email:
The sending of email is different. Email sending also requires a
server (SMTP server). But, when you subscribe to a phone plan, you do
not get built in email service. Secondly, when you buy a SIM, you have
a fixed number. But, incase of email, you have the liberty to create
hundreds of email accounts, the SMTP server of different email
provider will be different. Some even don't give the permission to use
SMTP server (offer only web based service). Unlike 'SmsManager, there
is no such EmailManager --- because there is no fixed email account
for you and no fixed SMTP server to send email through.

Fortunately, if you know what your email is(!), what your SMTP server
address is, whether you are allowed to send email via that --- then
you can write up a simple EmailManager for Android.
This may shed some light on that issue (if you want to send email
using gmail)
http://davanum.wordpress.com/2007/12/22/android-send-email-via-gmail-actually-via-smtp/


Regards
Sarwar Erfan



 Is every app that is to send mail to reinvent a very intricate, heavy
 wheel?  I guess I have a feature request to line up.

 tone

 On Aug 11, 2:42 pm, Mark Murphy mmur...@commonsware.com wrote:







  Well, SMS-by-Intent does not cause it to be sent, either. If you are
  looking for an analogue to SmsManager for sending emails, there is
  none -- sorry!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Sending email with attachment

2010-04-26 Thread andy
Hi,

I want to receive Intent android.intent.action.SEND in a Service. Is it
possilbe to register for this Intent via registerReceiver() and get the
Intent in Broadcast receiver in the Service?

Or is there any restrictions that android.intent.action.SEND can only be
registered via Manifest.xml of an Activity and not in a Service?

On Fri, Apr 16, 2010 at 9:03 PM, powder jonas.hey...@gmail.com wrote:


 Sorry for not responding earlier. This worked for me:

public static void sendFile(Context context) {
String emailPreference =

 PreferenceManager.getDefaultSharedPreferences(context).getString(emailPreference,
 );
String subjectPreference =

 PreferenceManager.getDefaultSharedPreferences(context).getString(subjectPreference,
 );
String bodyPreference =

 PreferenceManager.getDefaultSharedPreferences(context).getString(bodyPreference,
 );
if(subjectPreference.length() == 0) {
subjectPreference = (String)
 context.getText(R.string.csv_subject);
}
String csvFile = getFilename();
File file = new File(csvFile);
if(file.exists()) {
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[]
 {emailPreference});
sendIntent.putExtra(Intent.EXTRA_SUBJECT,
 subjectPreference);
sendIntent.putExtra(Intent.EXTRA_TEXT,
 bodyPreference);
sendIntent.setType(text/csv);
sendIntent.putExtra(Intent.EXTRA_STREAM,
 Uri.fromFile(new
 File(csvFile)));

  context.startActivity(Intent.createChooser(sendIntent,
 context.getText(R.string.csv_send)));
} else {
Util.displayToast(context, R.string.no_csv_file);
}
}

 On Apr 14, 10:18 am, Scout Ma scoutma2...@gmail.com wrote:
  Thanks for your help.
  I want to write an application which will send email with an
  attachment through GMail on Android.
  But I don't have much time to study the basic of JavaMail.
  So, I wonder is there any sample for me to get in quickly.
 
  2010/4/14 Kumar Bibek coomar@gmail.com
  
  So, you want to learn how to create an email app? It depends actually
  on the protocol that you want to work with. For POP and IMAP, there
  are libraries which you have to use. Check out Java Mail API for this.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Sending email with attachment

2010-04-16 Thread powder

Sorry for not responding earlier. This worked for me:

public static void sendFile(Context context) {
String emailPreference =
PreferenceManager.getDefaultSharedPreferences(context).getString(emailPreference,
);
String subjectPreference =
PreferenceManager.getDefaultSharedPreferences(context).getString(subjectPreference,
);
String bodyPreference =
PreferenceManager.getDefaultSharedPreferences(context).getString(bodyPreference,
);
if(subjectPreference.length() == 0) {
subjectPreference = (String)
context.getText(R.string.csv_subject);
}
String csvFile = getFilename();
File file = new File(csvFile);
if(file.exists()) {
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[]
{emailPreference});
sendIntent.putExtra(Intent.EXTRA_SUBJECT, 
subjectPreference);
sendIntent.putExtra(Intent.EXTRA_TEXT, bodyPreference);
sendIntent.setType(text/csv);
sendIntent.putExtra(Intent.EXTRA_STREAM, 
Uri.fromFile(new
File(csvFile)));
context.startActivity(Intent.createChooser(sendIntent,
context.getText(R.string.csv_send)));
} else {
Util.displayToast(context, R.string.no_csv_file);
}
}

On Apr 14, 10:18 am, Scout Ma scoutma2...@gmail.com wrote:
 Thanks for your help.
 I want to write an application which will send email with an
 attachment through GMail on Android.
 But I don't have much time to study the basic of JavaMail.
 So, I wonder is there any sample for me to get in quickly.

 2010/4/14 Kumar Bibek coomar@gmail.com

 So, you want to learn how to create an email app? It depends actually
 on the protocol that you want to work with. For POP and IMAP, there
 are libraries which you have to use. Check out Java Mail API for this.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Sending email with attachment

2010-04-14 Thread Scout Ma
Thanks for your help.
I want to write an application which will send email with an
attachment through GMail on Android.
But I don't have much time to study the basic of JavaMail.
So, I wonder is there any sample for me to get in quickly.


2010/4/14 Kumar Bibek coomar@gmail.com

So, you want to learn how to create an email app? It depends actually
on the protocol that you want to work with. For POP and IMAP, there
are libraries which you have to use. Check out Java Mail API for this.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Sending email with attachment

2010-04-13 Thread robl2e

@powder

Where should the setType() be placed then.  I'm having difficulties
getting this to work.


Thanks in advance.
On Apr 7, 2:11 pm, powder jonas.hey...@gmail.com wrote:
 Hi,

 Thanks so much Kumar!

 It turned out to be the placement of the line:

 sendIntent.setType(text/csv)

 Regards Jonas.

 On Apr 5, 2:43 pm, Kumar Bibek coomar@gmail.com wrote:



  public static void sendFile(Context context) {
                  File exportDir = new 
  File(Environment.getExternalStorageDirectory(),
                                  mydir);
                  if (!exportDir.exists()) {
                          exportDir.mkdirs();
                  }
                  String csvFile = exportDir + /file.csv;
                  File file = new File(csvFile);
                  if (file.exists()) {
                          Intent sendIntent = new Intent(Intent.ACTION_SEND);
                          sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV 
  file);
                          sendIntent.setType(text/csv);
                          sendIntent.putExtra(Intent.EXTRA_STREAM, 
  Uri.parse(file://
                                          + 
  Environment.getExternalStorageDirectory()
                                          + /mydir/file.csv));
                          sendIntent.putExtra(Intent.EXTRA_STREAM, Uri
                                          
  .parse(file:///sdcard/mydir/file.csv));
                          
  context.startActivity(Intent.createChooser(sendIntent,
                                          Send CSV file));
                  } else {
                          Toast.makeText(context, TTT, 
  Toast.LENGTH_LONG).show();
                  }

  This piece of code works fine. I got the mail with theattachment.

  Thanks and Regards,
  Kumar Bibek

  On Apr 5, 5:31 pm, Kumar Bibek coomar@gmail.com wrote:

   I will try this and let you know.

   Thanks and Regards,
   Kumar Bibek

   On Apr 2, 3:09 am, powder jonas.hey...@gmail.com wrote:

The logcat says:

...
04-01 18:33:06.230: INFO/ActivityManager(76): Starting activity:
Intent { act=android.intent.action.SEND typ=text/csv flg=0x300
cmp=com.google.android.gm/.ComposeActivityGmail (has extras) }
04-01 18:33:06.290: INFO/ActivityManager(76): Starting activity:
Intent { act=android.intent.action.SEND typ=text/csv flg=0x280
cmp=com.google.android.gm/.ComposeActivity (has extras) }
04-01 18:33:06.589: DEBUG/Gmail(4465): ComposeActivity added to
message:0attachment:|file.csv|text/csv|0|text/csv|LOCAL_FILE|file:///
sdcard/mydir/file.csv size:0
04-01 18:33:06.609: INFO/Gmail(4465): Attachmenturi:
file:///sdcard/mydir/file.csv
04-01 18:33:06.609: INFO/Gmail(4465):            type: text/csv
04-01 18:33:06.609: INFO/Gmail(4465):            name: file.csv
04-01 18:33:06.609: INFO/Gmail(4465):            size: 0
...

and the file size is 0. My file is attached in theemailas a file but
always with 0 bytes (my file is 510 bytes)?

On Apr 1, 1:27 pm, Kumar Bibek coomar@gmail.com wrote:

 Some logcat logs will be helpful in trying to figure out what went
 wrong.

 Thanks and Regards,
 Kumar Bibek

 On Apr 1, 2:10 pm, powder jonas.hey...@gmail.com wrote:

  Hi,

  I never got this to work on a real device, got theemailbut no
 attachment, also when installing K9 on a emulator and
  thensendingtheemailI see the mail in the outbox with a size of 0
  bytes:

  public static void sendFile(Context context) {
    File exportDir = new 
  File(Environment.getExternalStorageDirectory(),
  mydir);
    if (!exportDir.exists()) {
      exportDir.mkdirs();
    }
    String csvFile = exportDir + /file.csv;
    File file = new File(csvFile);
    if(file.exists()) {
      Intent sendIntent = new Intent(Intent.ACTION_SEND);
      sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
      sendIntent.setType(text/csv);
      //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
      //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:// +
  Environment.getExternalStorageDirectory() + /mydir/file.csv));
      sendIntent.putExtra(Intent.EXTRA_STREAM, 
  Uri.parse(file:///sdcard/
  mydir/file.csv));
      context.startActivity(Intent.createChooser(sendIntent, Send CSV
  file));
    } else {
      Util.displayToast(context, R.string.no_csv_file);
    }

  }

  Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Sending email with attachment

2010-04-08 Thread Ferm
Where should it be placed?

I also get size = 0 and then I get a error saying file//: attachment
paths must point to file:///sdcard Igonoring attachment file



On Apr 7, 11:11 pm, powder jonas.hey...@gmail.com wrote:
 Hi,

 Thanks so much Kumar!

 It turned out to be the placement of the line:

 sendIntent.setType(text/csv)

 Regards Jonas.

 On Apr 5, 2:43 pm, Kumar Bibek coomar@gmail.com wrote:



  public static void sendFile(Context context) {
                  File exportDir = new 
  File(Environment.getExternalStorageDirectory(),
                                  mydir);
                  if (!exportDir.exists()) {
                          exportDir.mkdirs();
                  }
                  String csvFile = exportDir + /file.csv;
                  File file = new File(csvFile);
                  if (file.exists()) {
                          Intent sendIntent = new Intent(Intent.ACTION_SEND);
                          sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV 
  file);
                          sendIntent.setType(text/csv);
                          sendIntent.putExtra(Intent.EXTRA_STREAM, 
  Uri.parse(file://
                                          + 
  Environment.getExternalStorageDirectory()
                                          + /mydir/file.csv));
                          sendIntent.putExtra(Intent.EXTRA_STREAM, Uri
                                          
  .parse(file:///sdcard/mydir/file.csv));
                          
  context.startActivity(Intent.createChooser(sendIntent,
                                          Send CSV file));
                  } else {
                          Toast.makeText(context, TTT, 
  Toast.LENGTH_LONG).show();
                  }

  This piece of code works fine. I got the mail with the attachment.

  Thanks and Regards,
  Kumar Bibek

  On Apr 5, 5:31 pm, Kumar Bibek coomar@gmail.com wrote:

   I will try this and let you know.

   Thanks and Regards,
   Kumar Bibek

   On Apr 2, 3:09 am, powder jonas.hey...@gmail.com wrote:

The logcat says:

...
04-01 18:33:06.230: INFO/ActivityManager(76): Starting activity:
Intent { act=android.intent.action.SEND typ=text/csv flg=0x300
cmp=com.google.android.gm/.ComposeActivityGmail (has extras) }
04-01 18:33:06.290: INFO/ActivityManager(76): Starting activity:
Intent { act=android.intent.action.SEND typ=text/csv flg=0x280
cmp=com.google.android.gm/.ComposeActivity (has extras) }
04-01 18:33:06.589: DEBUG/Gmail(4465): ComposeActivity added to
message:0 attachment:|file.csv|text/csv|0|text/csv|LOCAL_FILE|file:///
sdcard/mydir/file.csv size:0
04-01 18:33:06.609: INFO/Gmail(4465):  Attachment uri:
file:///sdcard/mydir/file.csv
04-01 18:33:06.609: INFO/Gmail(4465):            type: text/csv
04-01 18:33:06.609: INFO/Gmail(4465):            name: file.csv
04-01 18:33:06.609: INFO/Gmail(4465):            size: 0
...

and the file size is 0. My file is attached in the email as a file but
always with 0 bytes (my file is 510 bytes)?

On Apr 1, 1:27 pm, Kumar Bibek coomar@gmail.com wrote:

 Some logcat logs will be helpful in trying to figure out what went
 wrong.

 Thanks and Regards,
 Kumar Bibek

 On Apr 1, 2:10 pm, powder jonas.hey...@gmail.com wrote:

  Hi,

  I never got this to work on a real device, got the email but no
  attachment, also when installing K9 on a emulator and
  then sending the email I see the mail in the outbox with a size of 0
  bytes:

  public static void sendFile(Context context) {
    File exportDir = new 
  File(Environment.getExternalStorageDirectory(),
  mydir);
    if (!exportDir.exists()) {
      exportDir.mkdirs();
    }
    String csvFile = exportDir + /file.csv;
    File file = new File(csvFile);
    if(file.exists()) {
      Intent sendIntent = new Intent(Intent.ACTION_SEND);
      sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
      sendIntent.setType(text/csv);
      //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
      //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:// +
  Environment.getExternalStorageDirectory() + /mydir/file.csv));
      sendIntent.putExtra(Intent.EXTRA_STREAM, 
  Uri.parse(file:///sdcard/
  mydir/file.csv));
      context.startActivity(Intent.createChooser(sendIntent, Send CSV
  file));
    } else {
      Util.displayToast(context, R.string.no_csv_file);
    }

  }

  Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using 

[android-developers] Re: Sending email with attachment

2010-04-07 Thread powder

Hi,

Thanks so much Kumar!

It turned out to be the placement of the line:

sendIntent.setType(text/csv)

Regards Jonas.

On Apr 5, 2:43 pm, Kumar Bibek coomar@gmail.com wrote:
 public static void sendFile(Context context) {
                 File exportDir = new 
 File(Environment.getExternalStorageDirectory(),
                                 mydir);
                 if (!exportDir.exists()) {
                         exportDir.mkdirs();
                 }
                 String csvFile = exportDir + /file.csv;
                 File file = new File(csvFile);
                 if (file.exists()) {
                         Intent sendIntent = new Intent(Intent.ACTION_SEND);
                         sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
                         sendIntent.setType(text/csv);
                         sendIntent.putExtra(Intent.EXTRA_STREAM, 
 Uri.parse(file://
                                         + 
 Environment.getExternalStorageDirectory()
                                         + /mydir/file.csv));
                         sendIntent.putExtra(Intent.EXTRA_STREAM, Uri
                                         
 .parse(file:///sdcard/mydir/file.csv));
                         context.startActivity(Intent.createChooser(sendIntent,
                                         Send CSV file));
                 } else {
                         Toast.makeText(context, TTT, 
 Toast.LENGTH_LONG).show();
                 }

 This piece of code works fine. I got the mail with the attachment.

 Thanks and Regards,
 Kumar Bibek

 On Apr 5, 5:31 pm, Kumar Bibek coomar@gmail.com wrote:



  I will try this and let you know.

  Thanks and Regards,
  Kumar Bibek

  On Apr 2, 3:09 am, powder jonas.hey...@gmail.com wrote:

   The logcat says:

   ...
   04-01 18:33:06.230: INFO/ActivityManager(76): Starting activity:
   Intent { act=android.intent.action.SEND typ=text/csv flg=0x300
   cmp=com.google.android.gm/.ComposeActivityGmail (has extras) }
   04-01 18:33:06.290: INFO/ActivityManager(76): Starting activity:
   Intent { act=android.intent.action.SEND typ=text/csv flg=0x280
   cmp=com.google.android.gm/.ComposeActivity (has extras) }
   04-01 18:33:06.589: DEBUG/Gmail(4465): ComposeActivity added to
   message:0 attachment:|file.csv|text/csv|0|text/csv|LOCAL_FILE|file:///
   sdcard/mydir/file.csv size:0
   04-01 18:33:06.609: INFO/Gmail(4465):  Attachment uri:
   file:///sdcard/mydir/file.csv
   04-01 18:33:06.609: INFO/Gmail(4465):            type: text/csv
   04-01 18:33:06.609: INFO/Gmail(4465):            name: file.csv
   04-01 18:33:06.609: INFO/Gmail(4465):            size: 0
   ...

   and the file size is 0. My file is attached in the email as a file but
   always with 0 bytes (my file is 510 bytes)?

   On Apr 1, 1:27 pm, Kumar Bibek coomar@gmail.com wrote:

Some logcat logs will be helpful in trying to figure out what went
wrong.

Thanks and Regards,
Kumar Bibek

On Apr 1, 2:10 pm, powder jonas.hey...@gmail.com wrote:

 Hi,

 I never got this to work on a real device, got the email but no
 attachment, also when installing K9 on a emulator and
 then sending the email I see the mail in the outbox with a size of 0
 bytes:

 public static void sendFile(Context context) {
   File exportDir = new File(Environment.getExternalStorageDirectory(),
 mydir);
   if (!exportDir.exists()) {
     exportDir.mkdirs();
   }
   String csvFile = exportDir + /file.csv;
   File file = new File(csvFile);
   if(file.exists()) {
     Intent sendIntent = new Intent(Intent.ACTION_SEND);
     sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
     sendIntent.setType(text/csv);
     //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
     //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:// +
 Environment.getExternalStorageDirectory() + /mydir/file.csv));
     sendIntent.putExtra(Intent.EXTRA_STREAM, 
 Uri.parse(file:///sdcard/
 mydir/file.csv));
     context.startActivity(Intent.createChooser(sendIntent, Send CSV
 file));
   } else {
     Util.displayToast(context, R.string.no_csv_file);
   }

 }

 Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Sending email with attachment

2010-04-05 Thread Kumar Bibek
I will try this and let you know.

Thanks and Regards,
Kumar Bibek

On Apr 2, 3:09 am, powder jonas.hey...@gmail.com wrote:
 The logcat says:

 ...
 04-01 18:33:06.230: INFO/ActivityManager(76): Starting activity:
 Intent { act=android.intent.action.SEND typ=text/csv flg=0x300
 cmp=com.google.android.gm/.ComposeActivityGmail (has extras) }
 04-01 18:33:06.290: INFO/ActivityManager(76): Starting activity:
 Intent { act=android.intent.action.SEND typ=text/csv flg=0x280
 cmp=com.google.android.gm/.ComposeActivity (has extras) }
 04-01 18:33:06.589: DEBUG/Gmail(4465): ComposeActivity added to
 message:0 attachment:|file.csv|text/csv|0|text/csv|LOCAL_FILE|file:///
 sdcard/mydir/file.csv size:0
 04-01 18:33:06.609: INFO/Gmail(4465):  Attachment uri:
 file:///sdcard/mydir/file.csv
 04-01 18:33:06.609: INFO/Gmail(4465):            type: text/csv
 04-01 18:33:06.609: INFO/Gmail(4465):            name: file.csv
 04-01 18:33:06.609: INFO/Gmail(4465):            size: 0
 ...

 and the file size is 0. My file is attached in the email as a file but
 always with 0 bytes (my file is 510 bytes)?

 On Apr 1, 1:27 pm, Kumar Bibek coomar@gmail.com wrote:

  Some logcat logs will be helpful in trying to figure out what went
  wrong.

  Thanks and Regards,
  Kumar Bibek

  On Apr 1, 2:10 pm, powder jonas.hey...@gmail.com wrote:

   Hi,

   I never got this to work on a real device, got the email but no
   attachment, also when installing K9 on a emulator and
   then sending the email I see the mail in the outbox with a size of 0
   bytes:

   public static void sendFile(Context context) {
     File exportDir = new File(Environment.getExternalStorageDirectory(),
   mydir);
     if (!exportDir.exists()) {
       exportDir.mkdirs();
     }
     String csvFile = exportDir + /file.csv;
     File file = new File(csvFile);
     if(file.exists()) {
       Intent sendIntent = new Intent(Intent.ACTION_SEND);
       sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
       sendIntent.setType(text/csv);
       //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
       //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:// +
   Environment.getExternalStorageDirectory() + /mydir/file.csv));
       sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:///sdcard/
   mydir/file.csv));
       context.startActivity(Intent.createChooser(sendIntent, Send CSV
   file));
     } else {
       Util.displayToast(context, R.string.no_csv_file);
     }

   }

   Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Sending email with attachment

2010-04-05 Thread Kumar Bibek
public static void sendFile(Context context) {
File exportDir = new 
File(Environment.getExternalStorageDirectory(),
mydir);
if (!exportDir.exists()) {
exportDir.mkdirs();
}
String csvFile = exportDir + /file.csv;
File file = new File(csvFile);
if (file.exists()) {
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
sendIntent.setType(text/csv);
sendIntent.putExtra(Intent.EXTRA_STREAM, 
Uri.parse(file://
+ 
Environment.getExternalStorageDirectory()
+ /mydir/file.csv));
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri

.parse(file:///sdcard/mydir/file.csv));
context.startActivity(Intent.createChooser(sendIntent,
Send CSV file));
} else {
Toast.makeText(context, TTT, 
Toast.LENGTH_LONG).show();
}

This piece of code works fine. I got the mail with the attachment.

Thanks and Regards,
Kumar Bibek

On Apr 5, 5:31 pm, Kumar Bibek coomar@gmail.com wrote:
 I will try this and let you know.

 Thanks and Regards,
 Kumar Bibek

 On Apr 2, 3:09 am, powder jonas.hey...@gmail.com wrote:

  The logcat says:

  ...
  04-01 18:33:06.230: INFO/ActivityManager(76): Starting activity:
  Intent { act=android.intent.action.SEND typ=text/csv flg=0x300
  cmp=com.google.android.gm/.ComposeActivityGmail (has extras) }
  04-01 18:33:06.290: INFO/ActivityManager(76): Starting activity:
  Intent { act=android.intent.action.SEND typ=text/csv flg=0x280
  cmp=com.google.android.gm/.ComposeActivity (has extras) }
  04-01 18:33:06.589: DEBUG/Gmail(4465): ComposeActivity added to
  message:0 attachment:|file.csv|text/csv|0|text/csv|LOCAL_FILE|file:///
  sdcard/mydir/file.csv size:0
  04-01 18:33:06.609: INFO/Gmail(4465):  Attachment uri:
  file:///sdcard/mydir/file.csv
  04-01 18:33:06.609: INFO/Gmail(4465):            type: text/csv
  04-01 18:33:06.609: INFO/Gmail(4465):            name: file.csv
  04-01 18:33:06.609: INFO/Gmail(4465):            size: 0
  ...

  and the file size is 0. My file is attached in the email as a file but
  always with 0 bytes (my file is 510 bytes)?

  On Apr 1, 1:27 pm, Kumar Bibek coomar@gmail.com wrote:

   Some logcat logs will be helpful in trying to figure out what went
   wrong.

   Thanks and Regards,
   Kumar Bibek

   On Apr 1, 2:10 pm, powder jonas.hey...@gmail.com wrote:

Hi,

I never got this to work on a real device, got the email but no
attachment, also when installing K9 on a emulator and
then sending the email I see the mail in the outbox with a size of 0
bytes:

public static void sendFile(Context context) {
  File exportDir = new File(Environment.getExternalStorageDirectory(),
mydir);
  if (!exportDir.exists()) {
    exportDir.mkdirs();
  }
  String csvFile = exportDir + /file.csv;
  File file = new File(csvFile);
  if(file.exists()) {
    Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
    sendIntent.setType(text/csv);
    //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:// +
Environment.getExternalStorageDirectory() + /mydir/file.csv));
    sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:///sdcard/
mydir/file.csv));
    context.startActivity(Intent.createChooser(sendIntent, Send CSV
file));
  } else {
    Util.displayToast(context, R.string.no_csv_file);
  }

}

Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Sending email with attachment

2010-04-01 Thread Kumar Bibek
Some logcat logs will be helpful in trying to figure out what went
wrong.

Thanks and Regards,
Kumar Bibek

On Apr 1, 2:10 pm, powder jonas.hey...@gmail.com wrote:
 Hi,

 I never got this to work on a real device, got the email but no
 attachment, also when installing K9 on a emulator and
 then sending the email I see the mail in the outbox with a size of 0
 bytes:

 public static void sendFile(Context context) {
   File exportDir = new File(Environment.getExternalStorageDirectory(),
 mydir);
   if (!exportDir.exists()) {
     exportDir.mkdirs();
   }
   String csvFile = exportDir + /file.csv;
   File file = new File(csvFile);
   if(file.exists()) {
     Intent sendIntent = new Intent(Intent.ACTION_SEND);
     sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
     sendIntent.setType(text/csv);
     //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
     //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:// +
 Environment.getExternalStorageDirectory() + /mydir/file.csv));
     sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:///sdcard/
 mydir/file.csv));
     context.startActivity(Intent.createChooser(sendIntent, Send CSV
 file));
   } else {
     Util.displayToast(context, R.string.no_csv_file);
   }

 }

 Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Sending email with attachment

2010-04-01 Thread powder

The logcat says:

...
04-01 18:33:06.230: INFO/ActivityManager(76): Starting activity:
Intent { act=android.intent.action.SEND typ=text/csv flg=0x300
cmp=com.google.android.gm/.ComposeActivityGmail (has extras) }
04-01 18:33:06.290: INFO/ActivityManager(76): Starting activity:
Intent { act=android.intent.action.SEND typ=text/csv flg=0x280
cmp=com.google.android.gm/.ComposeActivity (has extras) }
04-01 18:33:06.589: DEBUG/Gmail(4465): ComposeActivity added to
message:0 attachment:|file.csv|text/csv|0|text/csv|LOCAL_FILE|file:///
sdcard/mydir/file.csv size:0
04-01 18:33:06.609: INFO/Gmail(4465):  Attachment uri:
file:///sdcard/mydir/file.csv
04-01 18:33:06.609: INFO/Gmail(4465):type: text/csv
04-01 18:33:06.609: INFO/Gmail(4465):name: file.csv
04-01 18:33:06.609: INFO/Gmail(4465):size: 0
...

and the file size is 0. My file is attached in the email as a file but
always with 0 bytes (my file is 510 bytes)?

On Apr 1, 1:27 pm, Kumar Bibek coomar@gmail.com wrote:
 Some logcat logs will be helpful in trying to figure out what went
 wrong.

 Thanks and Regards,
 Kumar Bibek

 On Apr 1, 2:10 pm, powder jonas.hey...@gmail.com wrote:



  Hi,

  I never got this to work on a real device, got the email but no
  attachment, also when installing K9 on a emulator and
  then sending the email I see the mail in the outbox with a size of 0
  bytes:

  public static void sendFile(Context context) {
    File exportDir = new File(Environment.getExternalStorageDirectory(),
  mydir);
    if (!exportDir.exists()) {
      exportDir.mkdirs();
    }
    String csvFile = exportDir + /file.csv;
    File file = new File(csvFile);
    if(file.exists()) {
      Intent sendIntent = new Intent(Intent.ACTION_SEND);
      sendIntent.putExtra(Intent.EXTRA_SUBJECT, CSV file);
      sendIntent.setType(text/csv);
      //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
      //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:// +
  Environment.getExternalStorageDirectory() + /mydir/file.csv));
      sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(file:///sdcard/
  mydir/file.csv));
      context.startActivity(Intent.createChooser(sendIntent, Send CSV
  file));
    } else {
      Util.displayToast(context, R.string.no_csv_file);
    }

  }

  Any help appreciated.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Sending Email

2009-09-28 Thread Isuru danagalle
I have done this.You need to remove awt dependecies from java mail and build
the activation jar and mail jar  manually.If you need the code and jar file
contact me.

Thanks
Isuru

On Wed, Sep 9, 2009 at 12:54 AM, Mark Murphy mmur...@commonsware.comwrote:


 Jason Proctor wrote:
  Only if you include your own SMTP code. ACTION_SEND will always prompt
  the user, at least if they choose one of the built-in apps.
 
  did we ever get to the bottom of why JavaMail doesn't work on Android?
 
  some Dalvik translation problem IIRC

 I haven't played with JavaMail in nearly a year. I ran into that Dalvik
 issue, read up on the CDDL (JavaMail's license), and my head started to
 hurt. :-(

 What's worse, there's little else in the way of Java SMTP client
 libraries, AFAICT.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://twitter.com/commonsguy

 _The Busy Coders' Guide to *Advanced* Android Development_ In Print!

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending Email

2009-09-28 Thread Isuru danagalle
However I couldnt send an image attachment  along with this.Reason is when
we remove awt  dependecies awt .Toolkit which is needed to implement
jpeg/png mailcap also removed
Thanks
Isuru

On Mon, Sep 28, 2009 at 12:14 PM, Isuru danagalle iisuru@gmail.comwrote:

 I have done this.You need to remove awt dependecies from java mail and
 build the activation jar and mail jar  manually.If you need the code and jar
 file contact me.

 Thanks
 Isuru


 On Wed, Sep 9, 2009 at 12:54 AM, Mark Murphy mmur...@commonsware.comwrote:


 Jason Proctor wrote:
  Only if you include your own SMTP code. ACTION_SEND will always prompt
  the user, at least if they choose one of the built-in apps.
 
  did we ever get to the bottom of why JavaMail doesn't work on Android?
 
  some Dalvik translation problem IIRC

 I haven't played with JavaMail in nearly a year. I ran into that Dalvik
 issue, read up on the CDDL (JavaMail's license), and my head started to
 hurt. :-(

 What's worse, there's little else in the way of Java SMTP client
 libraries, AFAICT.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://twitter.com/commonsguy

 _The Busy Coders' Guide to *Advanced* Android Development_ In Print!

 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending Email

2009-09-27 Thread alex-droid

I've created so-far fully working version of javamail based on the
source code available in the glassfish repository and some awt class
from harmony.
I'm not sure of what i can do with the license of what i have used to
make it work but i've put all of this in a google code project :
http://code.google.com/p/javamail-android/
full source code and binaries are available.
I've used a lot IMAP browsing, Mime Message parsing, so-far i've fixed
all the bugs i've encountered.
Feel free to report issue or to give me tips on i can distribute this
(freely of course)

On 8 sep, 21:24, Mark Murphy mmur...@commonsware.com wrote:
 Jason Proctor wrote:
  Only if you include your own SMTP code. ACTION_SEND will always prompt
  the user, at least if they choose one of the built-in apps.

  did we ever get to the bottom of whyJavaMaildoesn't work on Android?

  some Dalvik translation problem IIRC

 I haven't played withJavaMailin nearly a year. I ran into that Dalvik
 issue, read up on the CDDL (JavaMail'slicense), and my head started to
 hurt. :-(

 What's worse, there's little else in the way of Java SMTP client
 libraries, AFAICT.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _The Busy Coders' Guide to *Advanced* Android Development_ In Print!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email with Apache commons

2009-09-16 Thread Charlie Collins

You are trying to use classes that the Android platform simply doesn't
support (see the nice error message - in this case it's very
informative). In your case javax.naming from JNDI which is a core
class is not present, but regardless, not every java library runs or
is supported on Android (not everything that runs in a standalone
application which probably means desktop or server VM).

If you want to send email you might want to consider using an Intent
and going through the mailer UI so the user knows what's happening, or
if you want to do it programmatically it's purported that JavaMail
works without any porting (to use commons-email you will have to port
the parts Android doesn't support, that is, modify it to work with
Android).

See this thread for more info:
http://groups.google.com/group/android-developers/browse_thread/thread/c58d75c1ccfe598b/


On Sep 16, 8:15 am, Isuru danagalle iisuru@gmail.com wrote:
 Hi All,
            I am trying a simple send mail application using apache commons
 library.Here is the code.

 The email sending code is working fine in a standalone application.However
 when I try to run it as android application

 it gave following error message.

 trouble processing javax/naming/AuthenticationException.class:

 [2009-09-17 05:33:20 - Commons]

 Attempt to include a core VM class in something other than a core library.

 It is likely that you have attempted to include the core library from a
 desktop

 virtual machine into an application, which will most assuredly not work. If

 you really intend to build a core library -- which is only appropriate as

 part of creating a full virtual machine binary, as opposed to compiling an

 application -- then use the --core-library option to suppress this error

 message. If you go ahead and use --core-library but are in fact building

 an application, then please be aware that your build will still fail at some

 point; you will simply be denied the pleasure of reading this helpful error

 message.

 [2009-09-17 05:33:20 - Commons] 1 error; aborting

 [2009-09-17 05:33:20 - Commons] Conversion to Dalvik format failed with
 error 1

 I have added mail.jar,commons jars and jndi.jar to the references of eclipse

 If anybody know a resolution please let me know.

  *public* *void* onClick(View view) {

  String[] recipients = {recei...@gmail.com};

 SimpleEmail email = *new* SimpleEmail();

 email.addTo(sam...@gmail.com, John Doe);

 email.addTo(sam...@gmail.com, John Doe);

 email.setAuthentication(andr...@gmail.com, android);

 email.setHostName(smtp.gmail.com);

 email.setDebug(*true*);

 email.setSmtpPort(465);

 email.setSSL(*true*);

 *for* (*int* i = 0; i  recipients.length; i++)

 {

 email.addTo(recipients[i]);

 }

 email.setFrom(sen...@gmail.com, Me);

 email.setSubject(Test message);

 email.setMsg(This is a simple test of commons-email);

 email.send();

 Thanks  Regards,

 Isuru
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending Email

2009-09-08 Thread Mark Murphy

Iroid wrote:
 Hello All,
 Can I send an email without invoking any activity (with Send/SendTo
 action)?
 
 Just compose a mail and send to recipient from my application.
 
 Appreciate your response.

Only if you include your own SMTP code. ACTION_SEND will always prompt
the user, at least if they choose one of the built-in apps.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coders' Guide to *Advanced* Android Development_ In Print!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending Email

2009-09-08 Thread Mark Murphy

Jason Proctor wrote:
 Only if you include your own SMTP code. ACTION_SEND will always prompt
 the user, at least if they choose one of the built-in apps.
 
 did we ever get to the bottom of why JavaMail doesn't work on Android?
 
 some Dalvik translation problem IIRC

I haven't played with JavaMail in nearly a year. I ran into that Dalvik
issue, read up on the CDDL (JavaMail's license), and my head started to
hurt. :-(

What's worse, there's little else in the way of Java SMTP client
libraries, AFAICT.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coders' Guide to *Advanced* Android Development_ In Print!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email with HTML in body

2009-07-23 Thread Guillaume BOUERAT

same issue here...

On 23 juil, 15:29, Rmac ry...@me.com wrote:
 Hello,

 I have been unable to send anemailvia an Intent where theemail
 contains HTML in the body.  Theemailis created, but the HTML in the
 body shows as plain text instead of being rendered as HTML.  I have
 found similar posts where others have encountered the same problem,
 but so far no one has provided a solution.

 Here is a snippet of code to demonstrate:

 Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
 emailIntent.setType(text/html);
 emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]
 {t...@email.com});
 emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
 Subject);
 emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
 htmlbodyExample/body/html);
 context.startActivity(Intent.createChooser(emailIntent, Send
 mail...));

 Viewing theemailafter it is sent shows the body with HTML markup
 tags instead of just Example.  I'd sure appreciate any help in
 resolving this issue.  Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending Email from Android application

2009-06-24 Thread Peli

You can find the correct MIME type to send a text message here:
http://www.openintents.org/en/node/121
(scroll down for the sample code)

Peli
www.openintents.org

On Jun 24, 7:02 am, doubleminus doublemi...@gmail.com wrote:
 Swathi,

 Did you ever figure this one out??

 Thanks,
 double

 On May 12, 1:40 am, Swathi swathimuddin...@gmail.com wrote:

  I have tried to sendemailfrom myapplication in emulator , with
  following code.

  Intent sendIntent = new Intent(Intent.ACTION_SEND);
  sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
  sendIntent.putExtra(Intent.EXTRA_SUBJECT,
  subject.getText().toString());
  sendIntent.putExtra(Intent.EXTRA_TEXT,
  body.getText().toString());
  sendIntent.setType(text/plain);

  startActivity(Intent.createChooser(sendIntent, MySendMail));

  But i got an error No applications can perform this action.

  I tried by configuring Gmail in emulator, with the following code

          boolean debug = false;
          //Set the host smtp address
          Properties props = new Properties();
          props.setProperty(mail.transport.protocol, smtp);
          props.setProperty(mail.host, smtp.gmail.com);
          props.put(mail.smtp.auth, true);
          props.put(mail.smtp.port, 465);
          props.put(mail.smtp.socketFactory.port, 465);
          props.put(mail.smtp.socketFactory.class,
                               javax.net.ssl.SSLSocketFactory);
          props.put(mail.smtp.socketFactory.fallback, false);
          props.setProperty(mail.smtp.quitwait, false);
          Session session = Session.getDefaultInstance(props, this);
          session.setDebug(debug);
         try
         {
          // create a message
          Message msg = new MimeMessage(session);
          // set the from and to address
          InternetAddress addressFrom = new InternetAddress(from);
          msg.setFrom(addressFrom);
          InternetAddress[] addressTo =
                          new InternetAddress[recipients.length];
          for (int i = 0; i  recipients.length; i++) {
              addressTo[i] = new InternetAddress(recipients[i]);
          }
          msg.setRecipients(Message.RecipientType.TO, addressTo);
          // Setting the Subject and Content Type
          msg.setSubject(subject);
          msg.setContent(message, text/html);
          Transport.send(msg);
         }
         catch (Exception e) {
                  // TODO: handle exception
             System.out.println(Exception in Message+e.getMessage());
          }
      }

  But i got an error but i got an error
  java.lang.verifyError:javax.mail.internet.Mimemessage.

  Can anybody help me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending Email from Android application

2009-06-23 Thread doubleminus

Swathi,

Did you ever figure this one out??

Thanks,
double

On May 12, 1:40 am, Swathi swathimuddin...@gmail.com wrote:
 I have tried to sendemailfrom myapplication in emulator , with
 following code.

 Intent sendIntent = new Intent(Intent.ACTION_SEND);
 sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
 sendIntent.putExtra(Intent.EXTRA_SUBJECT,
 subject.getText().toString());
 sendIntent.putExtra(Intent.EXTRA_TEXT,
 body.getText().toString());
 sendIntent.setType(text/plain);

 startActivity(Intent.createChooser(sendIntent, MySendMail));

 But i got an error No applications can perform this action.

 I tried by configuring Gmail in emulator, with the following code

         boolean debug = false;
         //Set the host smtp address
         Properties props = new Properties();
         props.setProperty(mail.transport.protocol, smtp);
         props.setProperty(mail.host, smtp.gmail.com);
         props.put(mail.smtp.auth, true);
         props.put(mail.smtp.port, 465);
         props.put(mail.smtp.socketFactory.port, 465);
         props.put(mail.smtp.socketFactory.class,
                              javax.net.ssl.SSLSocketFactory);
         props.put(mail.smtp.socketFactory.fallback, false);
         props.setProperty(mail.smtp.quitwait, false);
         Session session = Session.getDefaultInstance(props, this);
         session.setDebug(debug);
        try
        {
         // create a message
         Message msg = new MimeMessage(session);
         // set the from and to address
         InternetAddress addressFrom = new InternetAddress(from);
         msg.setFrom(addressFrom);
         InternetAddress[] addressTo =
                         new InternetAddress[recipients.length];
         for (int i = 0; i  recipients.length; i++) {
             addressTo[i] = new InternetAddress(recipients[i]);
         }
         msg.setRecipients(Message.RecipientType.TO, addressTo);
         // Setting the Subject and Content Type
         msg.setSubject(subject);
         msg.setContent(message, text/html);
         Transport.send(msg);
        }
        catch (Exception e) {
                 // TODO: handle exception
            System.out.println(Exception in Message+e.getMessage());
         }
     }

 But i got an error but i got an error
 java.lang.verifyError:javax.mail.internet.Mimemessage.

 Can anybody help me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: sending email

2008-12-04 Thread Bill Napier

Searching this forum for the term send email gave me this mail:

http://groups.google.com/group/android-developers/browse_thread/thread/88bb36c676e3217b/c1d0be41174b4999?lnk=gstq=sending+email#c1d0be41174b4999

Which has some example code that you could use.

On Thu, Dec 4, 2008 at 10:51 AM, dilu [EMAIL PROTECTED] wrote:

 Hi
 i want to develop an aplication which can send email .so can any one
 provide me sample code or any link that is useful.I got one site
 davanum srinivas blog,but tht code is too old and full code is not
 available right now,they have removed it from site.So provide me some
 link.

 Thankss
 dilu
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: sending email

2008-12-04 Thread dileep singh
Thanks Bill Napier

On Fri, Dec 5, 2008 at 3:53 AM, Bill Napier [EMAIL PROTECTED] wrote:


 Searching this forum for the term send email gave me this mail:


 http://groups.google.com/group/android-developers/browse_thread/thread/88bb36c676e3217b/c1d0be41174b4999?lnk=gstq=sending+email#c1d0be41174b4999

 Which has some example code that you could use.

 On Thu, Dec 4, 2008 at 10:51 AM, dilu [EMAIL PROTECTED] wrote:
 
  Hi
  i want to develop an aplication which can send email .so can any one
  provide me sample code or any link that is useful.I got one site
  davanum srinivas blog,but tht code is too old and full code is not
  available right now,they have removed it from site.So provide me some
  link.
 
  Thankss
  dilu
  
 

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email

2008-11-14 Thread dave

I tried out k9mail on the emulator and I get the same error message
when I try to send an email from my application. has anyone gotten
this to work?

On Nov 4, 12:39 pm, Justin (Google Employee) [EMAIL PROTECTED]
wrote:
 Yes, you should be able to install the Email program's APK on the
 emulator. You could download the Android source and compile Email and
 then install on the emulator. Alternately I know there is a project
 that has forked (but will hopefully merge back their changes) the
 email client and there is a binary distribution you can get 
 fromhttp://code.google.com/p/k9mail/. I haven't tried it, but this should
 install on the emulator. Please let us know your results if you try
 this.

 Cheers,
 Justin
 Android Team @ Google

 On Nov 4, 6:24 am, john [EMAIL PROTECTED] wrote:

  Haha! Yes, it only works on the phone. Sorry for the mixup, I can be
  pretty absent minded at times.

  On Nov 3, 4:42 pm, Daniel Bradby [EMAIL PROTECTED] wrote:

   I'm assuming you meant to say it only works on the phone, not the
   emulator :)

   On 04/11/2008, at 1:13 AM, john [EMAIL PROTECTED] wrote:

Unfortunately yes, this only seems to work on the emulator. We had to
break down and buy a G1 (as well as a two-year plan) so we could
realistically get our software tested and released. It would be
interesting, though, to see if you could install theemailprogram on
the emulator. If you do, you might want to post it to help some people
out.

Good luck!

On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
John - I'm assuming this only works on the real device and not the
emulator?

I'm trying

                        Intent sendIntent = new
Intent(Intent.ACTION_SEND);
                        sendIntent.putExtra(Intent.EXTRA_TEXT,
emailtext);
                        sendIntent.putExtra(Intent.EXTRA_SUBJECT,
Subject);
                        sendIntent.setType(message/rfc822);

startActivity(Intent.createChooser(sendIntent, Title:));

and am getting No Applications can perform this action which is the
same when you select theemailaddress in the contact list of the
emulator. Prob because there is notemailclient in the emulator
right?

Justin - Is it possible to have access to the .apk for the mail
programs that come with the G1 so we can install them on the
emulator?

Thanks

On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

Hey, that did it! I set the the mime type to 'message/rfc822' and it
worked right away. Brings up the default mail application with the
fields that I specified populated.

I had been trying to send it with a mime of text/plain and text/
html.
I thought that by specifying anEXTRA_EMAILit would fire the right
broadcast receivers, but I guess the mime type is what counts.

Thanks again!

On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

John,

Take a look athttp://code.google.com/android/reference/android/
content/Intent.html,
there are several e-mail related fields you probably want to set.
For a
mime type try 'message/rfc822' or 'message/rfc2822'. I haven't
tried this
myself, so let me know how it works.

Cheers,
Justin
Android Team @ Google

Original Message Follows:

From: john [EMAIL PROTECTED]
Subject: [android-developers]Sendingemail
Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

Hello!

Thanks in advance for trying to help me out. It doesn't seem like
anyone has found a solution to this problem yet, so hopefully we
can
figure this out and help a lot of people.

I'm trying to get my application to send anemail, but i can't
seem to
find any solutions. Here's what I'm trying:

I've got an Intent (called sender in this example) set to
Intent.ACTION_SEND, with variousemailextras.

When I try startActivity(Intent.createChooser(sender, Select send
method.));
    I get No application can handle this request

And when I try sendBroadcast(Intent.createChooser(sender, Select
send
method.));
   Nothing happens at all.

Is there something I need to put in my manifest file, or am I doing
this completely wrong?

Any help anyone can offer would be greatly appreciated. Happy
coding!

-John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email

2008-11-14 Thread Justin (Google Employee)

Did you set he MIME type in your Intent?

Cheers,
Justin
Android Team @ Google

On Nov 14, 7:03 am, dave [EMAIL PROTECTED] wrote:
 I tried out k9mail on the emulator and I get the same error message
 when I try to send an email from my application. has anyone gotten
 this to work?

 On Nov 4, 12:39 pm, Justin (Google Employee) [EMAIL PROTECTED]
 wrote:

  Yes, you should be able to install the Email program's APK on the
  emulator. You could download the Android source and compile Email and
  then install on the emulator. Alternately I know there is a project
  that has forked (but will hopefully merge back their changes) the
  email client and there is a binary distribution you can get 
  fromhttp://code.google.com/p/k9mail/. I haven't tried it, but this should
  install on the emulator. Please let us know your results if you try
  this.

  Cheers,
  Justin
  Android Team @ Google

  On Nov 4, 6:24 am, john [EMAIL PROTECTED] wrote:

   Haha! Yes, it only works on the phone. Sorry for the mixup, I can be
   pretty absent minded at times.

   On Nov 3, 4:42 pm, Daniel Bradby [EMAIL PROTECTED] wrote:

I'm assuming you meant to say it only works on the phone, not the
emulator :)

On 04/11/2008, at 1:13 AM, john [EMAIL PROTECTED] wrote:

 Unfortunately yes, this only seems to work on the emulator. We had to
 break down and buy a G1 (as well as a two-year plan) so we could
 realistically get our software tested and released. It would be
 interesting, though, to see if you could install theemailprogram on
 the emulator. If you do, you might want to post it to help some people
 out.

 Good luck!

 On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
 John - I'm assuming this only works on the real device and not the
 emulator?

 I'm trying

                         Intent sendIntent = new
 Intent(Intent.ACTION_SEND);
                         sendIntent.putExtra(Intent.EXTRA_TEXT,
 emailtext);
                         sendIntent.putExtra(Intent.EXTRA_SUBJECT,
 Subject);
                         sendIntent.setType(message/rfc822);

 startActivity(Intent.createChooser(sendIntent, Title:));

 and am getting No Applications can perform this action which is the
 same when you select theemailaddress in the contact list of the
 emulator. Prob because there is notemailclient in the emulator
 right?

 Justin - Is it possible to have access to the .apk for the mail
 programs that come with the G1 so we can install them on the
 emulator?

 Thanks

 On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

 Hey, that did it! I set the the mime type to 'message/rfc822' and it
 worked right away. Brings up the default mail application with the
 fields that I specified populated.

 I had been trying to send it with a mime of text/plain and text/
 html.
 I thought that by specifying anEXTRA_EMAILit would fire the right
 broadcast receivers, but I guess the mime type is what counts.

 Thanks again!

 On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

 John,

 Take a look athttp://code.google.com/android/reference/android/
 content/Intent.html,
 there are several e-mail related fields you probably want to set.
 For a
 mime type try 'message/rfc822' or 'message/rfc2822'. I haven't
 tried this
 myself, so let me know how it works.

 Cheers,
 Justin
 Android Team @ Google

 Original Message Follows:
 
 From: john [EMAIL PROTECTED]
 Subject: [android-developers]Sendingemail
 Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

 Hello!

 Thanks in advance for trying to help me out. It doesn't seem like
 anyone has found a solution to this problem yet, so hopefully we
 can
 figure this out and help a lot of people.

 I'm trying to get my application to send anemail, but i can't
 seem to
 find any solutions. Here's what I'm trying:

 I've got an Intent (called sender in this example) set to
 Intent.ACTION_SEND, with variousemailextras.

 When I try startActivity(Intent.createChooser(sender, Select send
 method.));
     I get No application can handle this request

 And when I try sendBroadcast(Intent.createChooser(sender, Select
 send
 method.));
    Nothing happens at all.

 Is there something I need to put in my manifest file, or am I doing
 this completely wrong?

 Any help anyone can offer would be greatly appreciated. Happy
 coding!

 -John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at

[android-developers] Re: Sending email

2008-11-04 Thread john

Haha! Yes, it only works on the phone. Sorry for the mixup, I can be
pretty absent minded at times.

On Nov 3, 4:42 pm, Daniel Bradby [EMAIL PROTECTED] wrote:
 I'm assuming you meant to say it only works on the phone, not the  
 emulator :)

 On 04/11/2008, at 1:13 AM, john [EMAIL PROTECTED] wrote:



  Unfortunately yes, this only seems to work on the emulator. We had to
  break down and buy a G1 (as well as a two-year plan) so we could
  realistically get our software tested and released. It would be
  interesting, though, to see if you could install the email program on
  the emulator. If you do, you might want to post it to help some people
  out.

  Good luck!

  On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
  John - I'm assuming this only works on the real device and not the
  emulator?

  I'm trying

                          Intent sendIntent = new  
  Intent(Intent.ACTION_SEND);
                          sendIntent.putExtra(Intent.EXTRA_TEXT,  
  email text);
                          sendIntent.putExtra(Intent.EXTRA_SUBJECT,  
  Subject);
                          sendIntent.setType(message/rfc822);

  startActivity(Intent.createChooser(sendIntent, Title:));

  and am getting No Applications can perform this action which is the
  same when you select the email address in the contact list of the
  emulator. Prob because there is not email client in the emulator
  right?

  Justin - Is it possible to have access to the .apk for the mail
  programs that come with the G1 so we can install them on the  
  emulator?

  Thanks

  On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

  Hey, that did it! I set the the mime type to 'message/rfc822' and it
  worked right away. Brings up the default mail application with the
  fields that I specified populated.

  I had been trying to send it with a mime of text/plain and text/
  html.
  I thought that by specifying anEXTRA_EMAILit would fire the right
  broadcast receivers, but I guess the mime type is what counts.

  Thanks again!

  On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

  John,

  Take a look athttp://code.google.com/android/reference/android/
  content/Intent.html,
  there are several e-mail related fields you probably want to set.  
  For a
  mime type try 'message/rfc822' or 'message/rfc2822'. I haven't  
  tried this
  myself, so let me know how it works.

  Cheers,
  Justin
  Android Team @ Google

  Original Message Follows:
  
  From: john [EMAIL PROTECTED]
  Subject: [android-developers] Sending email
  Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

  Hello!

  Thanks in advance for trying to help me out. It doesn't seem like
  anyone has found a solution to this problem yet, so hopefully we  
  can
  figure this out and help a lot of people.

  I'm trying to get my application to send an email, but i can't  
  seem to
  find any solutions. Here's what I'm trying:

  I've got an Intent (called sender in this example) set to
  Intent.ACTION_SEND, with various email extras.

  When I try startActivity(Intent.createChooser(sender, Select send
  method.));
      I get No application can handle this request

  And when I try sendBroadcast(Intent.createChooser(sender, Select  
  send
  method.));
     Nothing happens at all.

  Is there something I need to put in my manifest file, or am I doing
  this completely wrong?

  Any help anyone can offer would be greatly appreciated. Happy  
  coding!

  -John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email

2008-11-04 Thread Justin (Google Employee)

Yes, you should be able to install the Email program's APK on the
emulator. You could download the Android source and compile Email and
then install on the emulator. Alternately I know there is a project
that has forked (but will hopefully merge back their changes) the
email client and there is a binary distribution you can get from
http://code.google.com/p/k9mail/ . I haven't tried it, but this should
install on the emulator. Please let us know your results if you try
this.

Cheers,
Justin
Android Team @ Google

On Nov 4, 6:24 am, john [EMAIL PROTECTED] wrote:
 Haha! Yes, it only works on the phone. Sorry for the mixup, I can be
 pretty absent minded at times.

 On Nov 3, 4:42 pm, Daniel Bradby [EMAIL PROTECTED] wrote:

  I'm assuming you meant to say it only works on the phone, not the
  emulator :)

  On 04/11/2008, at 1:13 AM, john [EMAIL PROTECTED] wrote:

   Unfortunately yes, this only seems to work on the emulator. We had to
   break down and buy a G1 (as well as a two-year plan) so we could
   realistically get our software tested and released. It would be
   interesting, though, to see if you could install theemailprogram on
   the emulator. If you do, you might want to post it to help some people
   out.

   Good luck!

   On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
   John - I'm assuming this only works on the real device and not the
   emulator?

   I'm trying

   Intent sendIntent = new
   Intent(Intent.ACTION_SEND);
   sendIntent.putExtra(Intent.EXTRA_TEXT,
   emailtext);
   sendIntent.putExtra(Intent.EXTRA_SUBJECT,
   Subject);
   sendIntent.setType(message/rfc822);

   startActivity(Intent.createChooser(sendIntent, Title:));

   and am getting No Applications can perform this action which is the
   same when you select theemailaddress in the contact list of the
   emulator. Prob because there is notemailclient in the emulator
   right?

   Justin - Is it possible to have access to the .apk for the mail
   programs that come with the G1 so we can install them on the
   emulator?

   Thanks

   On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

   Hey, that did it! I set the the mime type to 'message/rfc822' and it
   worked right away. Brings up the default mail application with the
   fields that I specified populated.

   I had been trying to send it with a mime of text/plain and text/
   html.
   I thought that by specifying anEXTRA_EMAILit would fire the right
   broadcast receivers, but I guess the mime type is what counts.

   Thanks again!

   On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

   John,

   Take a look athttp://code.google.com/android/reference/android/
   content/Intent.html,
   there are several e-mail related fields you probably want to set.
   For a
   mime type try 'message/rfc822' or 'message/rfc2822'. I haven't
   tried this
   myself, so let me know how it works.

   Cheers,
   Justin
   Android Team @ Google

   Original Message Follows:
   
   From: john [EMAIL PROTECTED]
   Subject: [android-developers]Sendingemail
   Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

   Hello!

   Thanks in advance for trying to help me out. It doesn't seem like
   anyone has found a solution to this problem yet, so hopefully we
   can
   figure this out and help a lot of people.

   I'm trying to get my application to send anemail, but i can't
   seem to
   find any solutions. Here's what I'm trying:

   I've got an Intent (called sender in this example) set to
   Intent.ACTION_SEND, with variousemailextras.

   When I try startActivity(Intent.createChooser(sender, Select send
   method.));
   I get No application can handle this request

   And when I try sendBroadcast(Intent.createChooser(sender, Select
   send
   method.));
  Nothing happens at all.

   Is there something I need to put in my manifest file, or am I doing
   this completely wrong?

   Any help anyone can offer would be greatly appreciated. Happy
   coding!

   -John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email

2008-11-03 Thread john

Unfortunately yes, this only seems to work on the emulator. We had to
break down and buy a G1 (as well as a two-year plan) so we could
realistically get our software tested and released. It would be
interesting, though, to see if you could install the email program on
the emulator. If you do, you might want to post it to help some people
out.

Good luck!

On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
 John - I'm assuming this only works on the real device and not the
 emulator?

 I'm trying

                         Intent sendIntent = new Intent(Intent.ACTION_SEND);
                         sendIntent.putExtra(Intent.EXTRA_TEXT, email text);
                         sendIntent.putExtra(Intent.EXTRA_SUBJECT, Subject);
                         sendIntent.setType(message/rfc822);

                         startActivity(Intent.createChooser(sendIntent, 
 Title:));

 and am getting No Applications can perform this action which is the
 same when you select the email address in the contact list of the
 emulator. Prob because there is not email client in the emulator
 right?

 Justin - Is it possible to have access to the .apk for the mail
 programs that come with the G1 so we can install them on the emulator?

 Thanks

 On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

  Hey, that did it! I set the the mime type to 'message/rfc822' and it
  worked right away. Brings up the default mail application with the
  fields that I specified populated.

  I had been trying to send it with a mime of text/plain and text/html.
  I thought that by specifying an EXTRA_EMAIL it would fire the right
  broadcast receivers, but I guess the mime type is what counts.

  Thanks again!

  On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

   John,

   Take a look 
   athttp://code.google.com/android/reference/android/content/Intent.html,
   there are several e-mail related fields you probably want to set. For a
   mime type try 'message/rfc822' or 'message/rfc2822'. I haven't tried this
   myself, so let me know how it works.

   Cheers,
   Justin
   Android Team @ Google

   Original Message Follows:
   
   From: john [EMAIL PROTECTED]
   Subject: [android-developers] Sending email
   Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

   Hello!

   Thanks in advance for trying to help me out. It doesn't seem like
   anyone has found a solution to this problem yet, so hopefully we can
   figure this out and help a lot of people.

   I'm trying to get my application to send an email, but i can't seem to
   find any solutions. Here's what I'm trying:

   I've got an Intent (called sender in this example) set to
   Intent.ACTION_SEND, with various email extras.

   When I try startActivity(Intent.createChooser(sender, Select send
   method.));
       I get No application can handle this request

   And when I try sendBroadcast(Intent.createChooser(sender, Select send
   method.));
      Nothing happens at all.

   Is there something I need to put in my manifest file, or am I doing
   this completely wrong?

   Any help anyone can offer would be greatly appreciated. Happy coding!

   -John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email

2008-11-03 Thread Daniel Bradby

I'm assuming you meant to say it only works on the phone, not the  
emulator :)



On 04/11/2008, at 1:13 AM, john [EMAIL PROTECTED] wrote:


 Unfortunately yes, this only seems to work on the emulator. We had to
 break down and buy a G1 (as well as a two-year plan) so we could
 realistically get our software tested and released. It would be
 interesting, though, to see if you could install the email program on
 the emulator. If you do, you might want to post it to help some people
 out.

 Good luck!

 On Oct 31, 4:04 pm, dbradby [EMAIL PROTECTED] wrote:
 John - I'm assuming this only works on the real device and not the
 emulator?

 I'm trying

 Intent sendIntent = new  
 Intent(Intent.ACTION_SEND);
 sendIntent.putExtra(Intent.EXTRA_TEXT,  
 email text);
 sendIntent.putExtra(Intent.EXTRA_SUBJECT,  
 Subject);
 sendIntent.setType(message/rfc822);

  
 startActivity(Intent.createChooser(sendIntent, Title:));

 and am getting No Applications can perform this action which is the
 same when you select the email address in the contact list of the
 emulator. Prob because there is not email client in the emulator
 right?

 Justin - Is it possible to have access to the .apk for the mail
 programs that come with the G1 so we can install them on the  
 emulator?

 Thanks

 On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:

 Hey, that did it! I set the the mime type to 'message/rfc822' and it
 worked right away. Brings up the default mail application with the
 fields that I specified populated.

 I had been trying to send it with a mime of text/plain and text/ 
 html.
 I thought that by specifying an EXTRA_EMAIL it would fire the right
 broadcast receivers, but I guess the mime type is what counts.

 Thanks again!

 On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

 John,

 Take a look athttp://code.google.com/android/reference/android/ 
 content/Intent.html,
 there are several e-mail related fields you probably want to set.  
 For a
 mime type try 'message/rfc822' or 'message/rfc2822'. I haven't  
 tried this
 myself, so let me know how it works.

 Cheers,
 Justin
 Android Team @ Google

 Original Message Follows:
 
 From: john [EMAIL PROTECTED]
 Subject: [android-developers] Sending email
 Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

 Hello!

 Thanks in advance for trying to help me out. It doesn't seem like
 anyone has found a solution to this problem yet, so hopefully we  
 can
 figure this out and help a lot of people.

 I'm trying to get my application to send an email, but i can't  
 seem to
 find any solutions. Here's what I'm trying:

 I've got an Intent (called sender in this example) set to
 Intent.ACTION_SEND, with various email extras.

 When I try startActivity(Intent.createChooser(sender, Select send
 method.));
 I get No application can handle this request

 And when I try sendBroadcast(Intent.createChooser(sender, Select  
 send
 method.));
Nothing happens at all.

 Is there something I need to put in my manifest file, or am I doing
 this completely wrong?

 Any help anyone can offer would be greatly appreciated. Happy  
 coding!

 -John
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email

2008-10-31 Thread dbradby

John - I'm assuming this only works on the real device and not the
emulator?

I'm trying

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, email text);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, Subject);
sendIntent.setType(message/rfc822);

startActivity(Intent.createChooser(sendIntent, 
Title:));

and am getting No Applications can perform this action which is the
same when you select the email address in the contact list of the
emulator. Prob because there is not email client in the emulator
right?

Justin - Is it possible to have access to the .apk for the mail
programs that come with the G1 so we can install them on the emulator?

Thanks

On Nov 1, 12:36 am, john [EMAIL PROTECTED] wrote:
 Hey, that did it! I set the the mime type to 'message/rfc822' and it
 worked right away. Brings up the default mail application with the
 fields that I specified populated.

 I had been trying to send it with a mime of text/plain and text/html.
 I thought that by specifying an EXTRA_EMAIL it would fire the right
 broadcast receivers, but I guess the mime type is what counts.

 Thanks again!

 On Oct 30, 3:20 pm, Justin [EMAIL PROTECTED] wrote:

  John,

  Take a look 
  athttp://code.google.com/android/reference/android/content/Intent.html,
  there are several e-mail related fields you probably want to set. For a
  mime type try 'message/rfc822' or 'message/rfc2822'. I haven't tried this
  myself, so let me know how it works.

  Cheers,
  Justin
  Android Team @ Google

  Original Message Follows:
  
  From: john [EMAIL PROTECTED]
  Subject: [android-developers] Sending email
  Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

  Hello!

  Thanks in advance for trying to help me out. It doesn't seem like
  anyone has found a solution to this problem yet, so hopefully we can
  figure this out and help a lot of people.

  I'm trying to get my application to send an email, but i can't seem to
  find any solutions. Here's what I'm trying:

  I've got an Intent (called sender in this example) set to
  Intent.ACTION_SEND, with various email extras.

  When I try startActivity(Intent.createChooser(sender, Select send
  method.));
      I get No application can handle this request

  And when I try sendBroadcast(Intent.createChooser(sender, Select send
  method.));
     Nothing happens at all.

  Is there something I need to put in my manifest file, or am I doing
  this completely wrong?

  Any help anyone can offer would be greatly appreciated. Happy coding!

  -John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sending email

2008-10-30 Thread Justin

John,

Take a look at
http://code.google.com/android/reference/android/content/Intent.html ,
there are several e-mail related fields you probably want to set. For a
mime type try 'message/rfc822' or 'message/rfc2822'. I haven't tried this
myself, so let me know how it works.

Cheers,
Justin
Android Team @ Google

Original Message Follows:

From: john [EMAIL PROTECTED]
Subject: [android-developers] Sending email
Date: Thu, 30 Oct 2008 08:02:36 -0700 (PDT)

Hello!

Thanks in advance for trying to help me out. It doesn't seem like
anyone has found a solution to this problem yet, so hopefully we can
figure this out and help a lot of people.

I'm trying to get my application to send an email, but i can't seem to
find any solutions. Here's what I'm trying:

I've got an Intent (called sender in this example) set to
Intent.ACTION_SEND, with various email extras.

When I try startActivity(Intent.createChooser(sender, Select send
method.));
I get No application can handle this request

And when I try sendBroadcast(Intent.createChooser(sender, Select send
method.));
   Nothing happens at all.

Is there something I need to put in my manifest file, or am I doing
this completely wrong?

Any help anyone can offer would be greatly appreciated. Happy coding!

-John




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---