In-app Email Functionality for Hybrid Application - javascript

I am building a hybrid mobile application (HTML5, JS, jQuery, CSS3) and need to implement in-app email functionality with following features:
Email feature to only send emails with predefined text and dynamically generated URLs (embedded within the email body)
This email feature should not send email via default email clients (like Gmail for Android). Sender email/ account will be defaulted to a constant value; it will not be user dependent.
Email to ask app-user to enter only the links which are to be send and the email-id of recipient (this feature is implemented as a form in the html page).
I have seen emailComposer However plugin. I am not sure if it routes the request via the default email client of your mobile.
Please provide inputs on how to build this functionality.

I could be wrong, but sending an email from a client using a pre-determined from is not likely something you'll be able to do. The reason I suspect this is because sending an email from a device to a mail server without the users direct interaction or personal email address opens the door for malicious applications to spam email servers with content. There may be a way to do it, but it would be much easier to send a request to a web server and have the web server send the email.
Stack Overflow questions seem to have possibly proven me wrong.
How to send email in background in Android ?

Related

Problem with Moodle Login using Web Services

Hello to the whole community. :)
I am currently working on integrating moodle for an e-learning platform. I have implemented most of the functionalities using web services (Javascript Client). But, unfortunately, I find that the web authentication service does not exist.
I said to myself, for authentication at the level of my system without redirecting the user to moodle from the information in the moodle database, I retrieve the password from the login and I test with the data entered by the user but the concern is that the core_user_get_users and core_user_get_users_by_fields functions do not send me the password (encrypted) but just the other information.
Need your help !!
core_user_get_users and core_user_get_users_by_fields are, quite correctly, incapable of sending the user's password, because Moodle itself doesn't know what the user's passwords are.
Moodle only stores a one-way hash of the user's passwords - each time a user logs in, the hash of the password they entered is compared with that in the database and the user is allowed in, if they match. By design, it is very difficult (and time consuming) to start with the hashed password in the Moodle database and figure out the user's password.
If you need a mechanism for logging a user in to Moodle from your system, without them having to enter a password, then you should consider using a Moodle authentication plugin that supports Single Sign On - the standard Moodle authentication plugins are listed at: https://docs.moodle.org/en/Authentication, but you may find that there is a 3rd-party authentication plugin that helps you at: https://moodle.org/plugins/?q=type:auth (https://moodle.org/plugins/auth_saml2 is often a good place to start).

HTML5 How to open the default email program without composing a new message

I know you can have someone open their local email application (like 'mail.app' on mac or outlook on windows) and compose a new message with the following
window.location.href = "mailto:mail#domain.com";
I was wondering if it is possible to open the local email application without also composing a new message?
The use-case is, after registration, people need to check their email to confirm their account. I do not need them to send a message.
UX notes outside the scope of this question
I do not force a redirect, but rather I have a 'check my email' and 'skip' button after logging in. I have coded, that 'if the email contains gmail.com' to redirect to mail.google.com, but there is no way to exhaustively hard-code all possible email addresses and to which url they should be redirected? therefore if the email address is not any of the major ones, I would like to opt to open the user's local email client (without composing an email message) - if this is possible.
This isn't possible from a technical perspective. There's no mechanism provided for it via JavaScript. The browser simply doesn't have that kind of permission to open a desktop app, and nor should it.
It may open a mail client specifically using the "mailto:" protocol for the single purpose of pasting the email address from the mailto link into the user's default mail client. Similarly, other protocols may (optionally) be matched to certain applications (e.g. tel: to start a phone call) on the device, but again only a very specific action can be carried out. It's not possible to simply open any arbitrary desktop application with no specific purpose in mind, no mechanism exists for it.

Auto generated email In Oracle JET

I am creating an Oracle JET application in which I want to send an email to the user containing the user password when they click Forgot Password. I tried this using mailto: but it opens the mail client. I want the application to send mail without opening the mail client. Can someone please explain how this could be done. Can this be done only by using RESTful web services? Thank you.
Sending a mail requires a server-side action, i.e. connecting to an SMTP server. So if your RESTful web service is written in a language that supports SMTP, then yes you can do it. For example: http://www.journaldev.com/2532/javamail-example-send-mail-in-java-smtp
It has nothing to do it with Oracle-JET, which is just a UI framework.
P.S.
If you absolutely want to use client-side JavaScript just for the fun of it this answer shows how. But as the comments on it say, it's a complete breach of security.

Get username in WCF service from web client on Windows and Citrix

My current project constists of 2 components:
a WCF server application
a purely client-sided (javascript, jQuery, TypeScript etc) website which consumes the service.
When the client saves data to my database via the WCF service, I need to log who made the last modification to that data.
To do this I need the username of the account the client website's browser is running under.
Browser support needs to be:
Chrome
Firefox
IE 10/11.
I don't want to create a login form for my website, I want the user to be able to open the website and be logged on using their Windows/Citrix account.
Javascript can't get to the account username because of security concerns obviously.
Any suggestions?
I have a experimental answer for you. Not sure but posible to work correctly. I think, you can activate impersonation and basic authentication on iis. Then client(browsers) ask credentials to client. In service layer, you can enable impersonation too. but only iis impersonation may enough.

opening client default mail application with lot of bcc address

I've implemented a functionality in my MVC 4 web application where the user can select a set of email addresses from a list and by clicking a button it opens the default mail client in the client computer with the selected email addresses in the bcc field and their own email address in the to field. This as a functionality works fine.
But when I started to test this with a long list of bcc email addresses, it didn't open the default email client and it didn't give any errors.
Then I tried to copy the complete url with the long list of bcc email addresses, paste it in a new browser window and tried to navigate from there to see if it works. then it gave me the URL too long http exception. I counted the number of characters in the mailto url which worked and it was around 1737 in Chrome. Is there anyway to override this problem and allow the user to open the default mail client in their computer with lots of bcc email address?
I can't use a server side solution to let them send emails as I can't allow them to use our mail server to send emails to lot of people at once.
any help is really appreciated!
thanks!

Categories

Resources