Android open email client with html content in cordova - android

I am making application in ionic and one of it's functionality to send mail so i have used plugin
problem is i am not able to generate link for android with gmail version > 6.10
Also tried to send mail using apps Gmail, Outlook, Bluemail every mail client giving different output.
Gmail version 6.10(ok) but 6.11(not generating links)
Outlook giving blank result (not event text as other mail client gives)
Bluemail same as Gmail
I'll be thankful if you have any solution of this.
EDIT
Sorry if you misunderstood "generate link" means using html content(<a href="...">)

Was using the plugin myself also, lots of problems and poorly maintained, just check their Github issues page to confirm, use this instead and you can specify to send via email using .shareViaEmail and include link in there.
Use var bodyText = document.getElementById("aaa").href; to get value for link, surely you must have <div><a href=‘YOURLINK’ id='aaa'>texthere</a></div> in HTML. Then pass it as as a message .shareViaEmail("PASS IT HERE",

Related

how to make email app in Android?

today I'm working with network in Android.I want to get mail from Gmail/Yahoo account and show them in textbox.Can anyone teach me how to fetch mail content ? I need a point to do it.
You can use javamail – android jar files to get and send email from android. From following you can also find a example to send email using android. This work is based on the opensourced version of JavaMail and activation (JAF) available in the glassfish repository, and some parts of Apache. You can find these files to download from this link https://code.google.com/p/javamail-android/downloads/list.
For Receiving email you can use following link. this link will be helpful for you http://www.javatpoint.com/example-of-receiving-email-using-java-mail-api

Given URL is not allowed by the Application configuration while login using facebook Jquery mobile [duplicate]

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
I have researched the most popular questions on SO already (Question 1, Question 2, Question 3, Question 4, and Question 5)... None of them help with my situation.
I have the application settings laid out like this...
App Domains: azeverything.com
Sandbox Mode: Disabled
Website with Facebook Login
Site URL: http://azeverything.com
****App Domains*** requires that no protocol be identified and Site URL requires that a protocol be identified.*
I have tried using www.azeverything.com and that didn't work either. Everything seems to match up. By the way, this is a WP site. I'm not developing locally either. It's all live.
Try to check at Settings > Advanced. At Valid OAuth redirect URIs, make sure you have a correct domain.
Hope it works.
You need to add the URL to your app:
Go to the app, you want for user login, on the Facebook Developers page
Click on the settings tab
Click add platform
Select Website
After selection it will ask for some details such as URL for your website which uses login with facebook feature, fill the form and submit it
That's all and you are done. Make sure that the app's URL is the same from where you're logging in.
Under Basic settings:
Add the platform - Mine was web.
Supply the site URL - mind the http or https.
You can also supply the mobile site URL if you have any - remember to mind the http or https here as well.
Save the changes.
Then hit the advanced tab and scroll down to locate Valid OAuth redirect URIs its right below Client Token.
Supply the redirection URL - The URL to redirect to after the login.
Save the changes.
Then get back to your website or web page and refresh.
This is a basic breakdown for slow people like me, and I didn't see this mentioned before.
The "redirect uri" isn't the place where you're redirecting to, but where it's coming from.
Say you have your app at http://myFBapp.com listening to /auth/facebook, and after they log in, redirecting them to /UserLoginHooray. The "Valid OAuth redirect URIs" should read http://myFBapp.com/auth/facebook, not http://myFBapp/UserLoginHooray.
Explanation:
HTTP Requests that have been redirected (302) include the original address in the header, so Facebook is merely putting a very basic layer of security on the request.
I chased my tail on this issue for hours. My coder and I could login with FB without a problem but my wife couldn't. She would get this topic's subject message. I tried every setting and URL that I could think of for my Lavarel app.
My issue was that my wife was signing in from:
http://www and we were using http://
A short trip to CPanel and a redirect fixed that. Hope this helps someone!
For Lavarel these FB app settings worked for me:
Settings/Basic - App Domain: mydomain.com , Site URL: http://mydomain.com/login.
Settings/Advanced - Client OAuth Login: Yes.
Settings/Advanced - OAuth redirect URIs: http://mydomain.com , http://mydomain.com/login.
App Details/App Center listed platforms = No. I'm only using the login for now.
I have a website with facebook login.
It has been stable and working for months.
No code change has happened for weeks.
Then, suddenly, the facebook login gives an error message:
Error
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
After debugging "for awhile", I reset my facebook app secret and it started to work again!
Michael Blackburn's answer helped me resolve my issue, but I want to give more detail on my fix.
I have a php app that posts to a user's FB page.
I own two domains:
http://app.my-web-app.com
http://app.mywebapp.com (no hyphen)
I built my site off the first domain because it read better IMHO (at least it did at the time).
Some users typoed the url so I bought the second one with no dashes for that reason.
So, one of my users was having the "Given URL" error.
Turns out he was going to http://app.mywebapp.com and the rest of them were going to http://app.my-web-app.com
I fixed everyone by adding all possible redirect URIs:
Granted, there are 100 better ways to implement this, but here is the workaround for now.
1.Make Sure Website Url and platform added, if not then visit https://developers.facebook.com/quickstarts/ then Select
Platform -> Setup SDK -> Website Url And so on..
Note: website url can't be like this : https://www.example.com just remove www and make it simple and working ;)
2.Goto App Dashboard -> Setting -> Click on Advanced Tab then go to bottom of the page and enable Embedded Browser OAuth Login
and leave Valid OAuth redirect URIs blank and Save it
I found Valid OAuth Redirect URIs under PRODUCTS then Facebook Login > Settings not as everyone is stating above. I am supposing this is a version issue.
It still didn't work for me. I guess I really have to add Android Platform rather than just the Website. This is annoying because my app is still in development mode :(
UPDATE: I'm using Expo to develop my react-native app and used info provided here: https://developers.facebook.com/apps/131491964294190/settings/basic/ to set up the Android and iOS platforms. This resolved the issue for me.
Sometimes this error occurs for old javascript sdk. If you save locally javascript file. Update it. I prefer to load it form the facebook server all the time.
Go to facebook developer dashboard
Select settings -> select WEB(for website) -> Add platform
Add your site URL.
This should resolve your issue.
So... facebook distinguishes pretty harshly between http and https in your app. This is just another small thing to check if you run into trouble.
I solved this issue by specifying correct site URL in my App Settings.
It works fine now. You have to specify your website Url such as http://www.xyz.com/
Under advanced tab make sure "Valid OAuth redirect URIs" contains valid URI or leave it empty(not recommended)
"http://example.com/"
instead of
"http://www.example.com"
sometimes you need to check your code (the part of redirect)
$helper = new FacebookRedirectLoginHelper('https://apps.facebook.com/xxx');
$auth_url = $helper->getLoginUrl(array('email', 'publish_actions'));
echo "<script>window.top.location.href='".$auth_url."'</script>";
if any changes happens there (for example, the name of your application "https://apps.facebook.com/xxx" in relation the application settings in facebook, you will get the above error
For Android Developers,
Make sure you have enabled Facebook Login inside the Products list inside Dashboard of your Facebook project app and have added all the required details as you go through the whole flow.
The login should work without giving the same error.

Submitting form using mailto

I am having an issue submitting with my form which I have built using jquery mobile and uploaded onto my android tablet using Phonegap build.
The script I am using is
<script>
function formSubmit()
{
document.getElementById("SiteVisit").action ="mailto:pja#bresnan.net?cc=" + document.getElementById("COC_Received_By").value + "&subject=Site%20Visit%20Form";
document.getElementById("SiteVisit").submit();
}
</script>
<form method="post" enctype="text/plain" name="SiteVisit" id="SiteVisit">
I keep getting an Application Error that "The Protocol isn't Supported"
I am not real code savvy...can someone please help me out with this one
I don't think you can just submit a form like this. Usually, on a normal web browser, you can't - you need the browser to be configured to use email. This is likely a browser configuration issue.
If you want things sent by email you can use one of the email plugins for PGB.
You set up your form to send its information to the email program. There are two ways to do it - 1. the user fills in a form and when they click Send all the info is sent to the email app and the user has to click Send again. 2. You just have the email option.
I use version 1 because, as it's a form, you can have the email pre-populated with the options from the Form. E.g. If you have a star rating you can pass the value from the form to the email. The heading of the email, for example, would be "Service Rating 5/5" or "Service Rating 3/5". Iyswim.

Email dialog HTML ignores some tags Titanium Moblie

I'm currently building an app that has Email sending capabilities. I'm trying to send an Email with the relevant information and includes a link to the original post that is being sent. the original post is created as an HTML code segment, so I have to send the Email as an HTML. i create the Email dialog like this:
var mail = Ti.UI.createEmailDialog({
subject:'FW:'+post.desc,
html:true,
messageBody: '<br><br>view original post<br><br><b style="font-size:1.5em;font-family:Arial">'+post.desc+'</b><br><br><i>'+metaData.text.toString().replace(/\n/g,'<br>')+' </i><br><br>'+post.htmlData
});
Ti.API.debug(mail.messageBody)
mail.open();
when I ran the app on my device, I got the option of sending via "mail" or via "Gmail". when sent via "mail", all the link tabs and and were ignored and striped so the Email didn't include them. however, the "Gmail" option left everything as suppose to.
any thoughts?
the question was asked also in Titanium Q&A
Apparently, the default Email client for Android doesn't have a HTML renderer and disregards it, and the Gmail Android client won't parse certain tags like .
it seems to me like the answer will be using temporary files and attachments.
if anybody comes up with a better answer I'll be very happy.
happy X-mas | Hanukah | festivus for the rest of us

MAILTO Link in email to start a new email

I have a contact form on a website for customers to contact my company. Upon completing this form a correspondence is sent to the appropriate sales associate for that region. In this email it captures the information provided in the contact form the customer provided. More often than not the customer is requesting more information than what is available on our website.
I would like to include a MAILTO link in the email sent to the sales associate that would allow them a one click option to send additional documents/information/webpages not open to public traffic to customers requesting the information. Something along the lines of:
<a href="mailto:customer#email.com&subject=Information
Requested&body=Here's more information.
http://www.website.com/info/info.pdf">Send More Info</a>
I've tested this link and found it works perfectly in Outlook, Thunderbird and even GMail. But on mobile devices such as Android, iPhone or iPad the entire portion of the MAILTO string is put in the recipient line. I've tried URL encoding the link to something like:
<a href="mailto:customer#email.com&subject=Information
Requested&body=Here's more information.%0A%0A
http:%3A%2F%2Fwww.website.com%2Finfo%2Finfo.pdf">Send More Info</a>
But this doesn't seem to change anything at all as the desired result is still not achieved. The second link still works properly in other email client just not mobile devices. My searching has led me to only find articles about creating the MAILTO link in code specific for Android or iOS devices.
Any way to make this solution work in a normal email or webpage? Thanks!
Monday morning mistake on a Friday.
<a href="mailto:customer#email.com?subject=Information
Requested&body=Here's more information.
http://www.website.com/info/info.pdf">Send More Info</a>
Note the change of the question mark before the subject instead of an ampersand.
Yes, it's the ampersand. This works when using desktop email but when you switch to a mobile device it just causes it to be dumped into the "to:" line. Changing the ampersand to a question mark will make it work in both desktop and mobile environments.

Categories

Resources