How do you start the Mail app from a Titanium app?
I am looking for the equivalent of an HTML mailto: link where I can specify the email and maybe the subject from with in a windowView.
I am not using a webView.
Will
Try this one:
var emailDialog = Titanium.UI.createEmailDialog();
emailDialog.subject = "Sending email from Titanium";
emailDialog.toRecipients = ['name#gmail.com'];
emailDialog.messageBody = 'Appcelerator Titanium - Testing sending email';
emailDialog.open();
But remember that you cannot test this send email feature from iPhone Simulator (because iPhone simulator lacks of setting email account). Try to check in real phone.
Related
I am using NSSharingService to prepare an email with attachment for the user of my macOS app. My code is:
let emailService = NSSharingService.init(named: NSSharingService.Name.composeEmail)
if emailService.canPerform(withItems: [emailBody, zipFileURL]) {
// email can be sent
DispatchQueue.main.async {
emailService.perform(withItems: [emailBody, zipFileURL])
}
} else {
// email cannot be sent
// Show alert with email address and instructions
self.showErrorAlert(with: 2803)
}
This works correctly, but if the code is executed on a fresh system, Apple Mail will be opened asking the user to configure an email account. Some users may not understand what is going on in this situation. Is there a way to ascertain if the default Email Client is configured, so that I can inform the user if it is not ? Thanks for your help.
I am creating a windows phone 8 app. I have created a PDF document and now I want to send this PDF to an email address. But I do not know how to proceed with this.
Please Help me.
Thanks,
(First search search search then ask)
see this one MSDN:
To send normal email,you should add:
using Microsoft.Phone.Tasks;
to your code, and then for personalizing and going to the mail app add this:
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.Subject = "message subject";
emailComposeTask.Body = "message body";
emailComposeTask.To = "recipient#example.com";
emailComposeTask.Cc = "cc#example.com";
emailComposeTask.Bcc = "bcc#example.com";
emailComposeTask.Show();
for sending attachemnts see these links once
end-email-with-attachments-without-using-emailcomposetask-with-mailmessage
how-to-send-automated-emails-with-attachments-from-windows-phone-apps
I'm trying to create a windows store app that will launch the default mail app (WinJS 8.1). I haven't touched this for a while, but it was working correctly before 8 - 8.1 upgrade. The code looks like this:
var interval = setInterval(function () {
clearInterval(interval);
var formattedBodyText = bodyText.replace(/\n/g, '%0d');
var mailTask = Email.SendNewMail.sendEmail(emailAddress, subject, formattedBodyText);
}, 500);
And the sendEmail function:
sendEmail: function sendEmail(addess, subject, body) {
var mailto = new Windows.Foundation.Uri("mailto:?to=" + addess + "&subject=" + subject + "&body=" + body);
return Windows.System.Launcher.launchUriAsync(mailto);
}
Oddly, this seems to launch Chrome (I assume because that's my default browser). How can I get it to launch the mail app? Has this changed since the 8.1 upgrade?
EDIT:
It looks like the default program for opening mails was changed to Chrome. So, I suppose my question is now: is it possible to FORCE the mail app to open, rather than whatever is associated with the mailto: url? I noticed there was an ms-mail uri - would that be safer to use?
You can't determine which is default mail app in Windows Store app. Moreover there's no way to open Mail app forcefully in Windows Store app. It doesn't make sense. Some user (Like me!) might not like default mail app. So I would recommend to stick to share charm for sending emails.
My HoneyComb application runs on tablets and Google TV. I have setting to send email in my settings fragment, but it returns error of "No app can handle this function."
Is there a way to send email to browser through my application if there is no client (createChooser) available?
I also tried to display a summary of the customer service email, but summary is not working on HoneyComb. I was trying this so I could have disabled Intent on tv.
Is there a way to send email to browser through my application if there is no client (createChooser) available?
Not unless you know the specific email Web app and all of its details, and that email Web app supports some sort of direct-email-sending capability.
Either prompt the user to install an email app, or send the email yourself (e.g., JavaMail), or do not use email for communications on Google TV. I would expect few Google TV users to be using email on their televisions, so you need to plan accordingly.
Google TV includes a default, stub email app, so the system will appear to have an email app installed, even when there is none. There's a special check necessary to detect the stub:
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("plain/text"); // special mime legacy for gmail; others work
List<ResolveInfo> match = getPackageManager().queryIntentActivities(emailIntent, 0);
boolean hasEmailer = match.size() > 0;
Log.w("thuuz", "has plain/text Emailer: " + hasEmailer);
if (match.size() == 1) {
ResolveInfo info = match.get(0);
boolean real = true;
if (info.activityInfo.packageName.startsWith("com.google.android.tv.frameworkpackagestubs"))
real = false;
Log.w("thuuz", "has *real* Emailer: " + real);
}
I am new to iOS development. I had created an iOS application. In my app, when an email is detected , I had written code to launch the default email application in iPhone.
And upto this, it was working fine. The default iPhone compose mail interface is launching and I can send the mail.
But the problem is after sending the mail,the control is not returning back to the app.
What can I do to return the control back to my app ?
Experts please help.
Instead of launching the default email application in iPhone, use MFMailComposeViewController interface to send email.
See here for more refernce.
Dismiss the mail view in MFMailComposeViewController delegate method "didFinishWithResult"
-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self dismissModalViewControllerAnimated:YES];
}
All the best.