I want to send emails with javamail-android but I'am using a host server different than usual ones (Gmail, Yahoo, Hotmail, etc). The host is accessed via APN throught the mobile data network, I don't know how configure this. Currently my code for sending email setup all fields like this:
mailer.setFrom("myself#xxxxx.com");
mailer.setUser("myself#xxxxx.com");
mailer.setPassword("xxxxxxxxxx");
mailer.setHost("smtp.xxxxx.xx");
mailer.setPort(25);
mailer.setSocketFactoryPort(25); // ?
I'm getting the next error Unknown SMTP host: smtp.xxxxx.xx. I know for sure that at least the above data is OK. But I don't know how to use the previous configuration on APN and "mobile-data". Is there something wrong with this configuration ? Do I have to change something to make it work with APN and mobile data network?
My code for sending email is almost the same described here.
Related
I'm trying to implement a local VPN service in my app to register the entrance to the address: example.com
Something like firewall app for Android.
As an example I used: https://github.com/hexene/LocalVPN
Regarding this example I'm able to set breakpoint in the process loop and debug packages.
But only what I get is: source/destination IP, HOST, protocol and other:
W/VPNRunnable: IP4Header{version=4, IHL=5, typeOfService=0, totalLength=40, identificationAndFlagsAndFragmentOffset=884883456, TTL=64, protocol=6:TCP, headerChecksum=14993, sourceAddress=10.0.0.2, destinationAddress=172.217.20.166, hostNameDesc=waw02s07-in-f166.1e100.net, hostNameSour=waw02s07-in-f166.1e100.net}
My question: It is possible to determine what is the full URL of the request?
URL like: http://example.com/test/page?a=111&b=222
I have a server and an android app. My server want to request a destination but with the IP of the android device that my app is running on. So I need to proxy the requests (relay them) in my app so the destination could see the client's IP but the server. You can see my explanation in the picture:
How can I do this in my app?
Yes this could be done but not just with relays; you also need to port forwarding mechanism in between. Here is how I would try to do this:
Local portforward the requests of the server onto a dedicated port on your android device and then from their call the Destination server via your relay mechanism which could be fulfilled very succicntly by LittleProxy like solution.
A sample mobile application sends POST requests to a HTTP server which we use to process information sent from the mobile application. We parse HTTP headers and the User-Agent header is always seen as "Apache-HttpClient" on all Android devices with different OSes.
If i perform any action from app in android device, it returns the user agent as Apache-HttpClient/UNAVAILABLE (java 1.4)
what's the problem? It doesn't provide me a User Agent string which contains information like OS information and other details.. Has anyone seen similar behavior before?
Apache-HttpClient/UNAVAILABLE (java 1.4)
Is the default User Agent string for the Apache client that your app is using, it is not an error in itself.
This client know's very little about the system that it is running on, which is for the best - it's just a simple one-size-fits-all method for an Android device (which could be a phone, a tablet, a TV or even a car!) to make http requests to the outside world.
User Agent strings are a way for User Agents (read "browsers") to identify themselves.
In the case of an Android App, your App is the browser, so the User agent string is for you to define within your app.
See: Android Generic User Agent (UA)
If you want to send information about the device then you need to collect that information with your app and then send it. Though, if you are collecting that data then you might as well put it in the body of the request rather than HTTP headers anyway.
i am using the default email app that come with ics, and i want to catch the email recieving programatically (i want to recieve and sender information and the email body itself), how can i do it? i tried search however i only find how to send email and how to recieve email in gmail (which is not my case)
thanks
Unfortunately, there is no way to "catch" emails as they come to the phone. You'll have to manually connect to the mail server and download the emails. If you're interested in doing that, I've used the javamail-android port, which actually is pretty fully featured.
I want to send mail through the help of SMTP server. currently I am using CreateEmailDailog but in this, when press Send button then mail is sent.
I want to with any press my mail is send in background. I want to use set recipient, subject and message body default.
any suggestion is appreciated.
There is no ready-made SMTP support in Titanium SDK. You need to implement yourself with using TCPSocket operations.
Check http://docs.appcelerator.com/titanium/2.0/index.html#!/api/Titanium.Network.Socket.TCP for documentation and example code.
SMTP protocol is easy. There are few commands like; EHLO, MAIL FROM, RCPT TO, AUTH LOGIN, DATA, QUIT. You can find all protocol specification on RFC documentations.