Using MFMailComposeViewController with UTF-8 domains and/or usernames - ios

I'm trying to prepopulate the MFMailComposeViewController with an email address that has a UTF-8 domain (e.g. hello#闪闪发光.com ). However, when I call setToRecepients on my object, I get a message in the console that 'hello#闪闪发光.com is not a valid email address and the email controller comes up with an empty To field. If I use the same email address and just type it in directly, I get a warning that it is not a valid email address, but I am given the option to send anyway.
Is this just something not supported? UTF-8 domain may not be too common but they're definitely out there. I tried to encode the value with stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding but that didn't do it.
Any thoughts? Anybody run into this before? Workarounds?
I also just tried this in the latest 6.0 SDK using Apple's sample code with only the To address changed to UTF-8, same result.
I posted this on the Apple dev forums but I usually get a better response here so I'm trying here too.

You can try using NSUTF16StringEncoding instead of NSUTF8StringEncoding. Further you can refer the different types of encoding

Related

How to find the WiFi password on XP?

This is not as simple as it may seem. I've got 2 hosts connected via wifi and I need to know the password they use. I cannot access the access point cause I don't know the credentials. When i get in the network property panel from XP I can't find the authentication tab anywhere. I also tried to install some software to find it. That almost worked. It gave me an hex code and not the proper password. I tried to convert that code to ascii but the resulting string was not correct. Finally I decided to contact the company whose name was on the router. I did that more times and every time they gave me different pass codes but none of them worked. Do you have any idea?
here is a best way to find wifi password http://www.info9.pw/

AFNetworking iOS JSON Parsing incorrect in just Lebanon

My application has a weird problem. I have a login webservice which is used to authenticate the users, it works well for everyone except for a tester who is in Lebanon. For her, the request always fails. It turns out that the json response is not getting parsed for her.
My first guess was that her network place is using a proxy server that converts json to html, so I asked her to switch to cellular network but this isn't solving the problem either.
Please refer to the debug message in the screenshot below.
Any suggestions on what must be wrong will be greatly helpful.
You'd really need the exact data that was received. JSON parsing is totally independent of any localisation. On the other hand, whatever service produced the JSON data may not. There is a good chance that being in the Lebanon, that customer receives non-ASCII data (which should be just fine), while other customers don't. It is possible that the server sends that data not in UTF-8 but say in some Windows encoding. That would be fine for ASCII but not for non-ASCII data. Or it could be that the server figures out that full UTF-8 is needed and not ASCII, and transmits a byte order marker, which is not legal JSON and would likely create the error message that you received.
To reproduce, I'd try to set up things so that non-ASCII data would be used. For example a username or password with non-ASCII data.

iOS - Secure way to get data out of an app for a researcher

tl;dr What's the "right" way to get my data off an iPad such that only a researcher can receive and read it?
Full Explanation:
In my app, I've got to get the data from a database off the app and to a researcher. This will consist (most likely) of two separate files. The first will be table of identifying information:
ID FirstName ... etc.
This is sensitive identifying information that has to be sent so that only the researcher can get it.
The other will be de-identified info that uses ID numbers and the like, and it doesn't necessarily have to be secure, but I would like to only have it go to the researcher, obviously.
So far, I've only ever worked with data that can just be emailed, but there are some problems with this implementation. You can't just up and send an email; you can only present an email composition view ready to send, and then the user can edit the email before sending it. So a user could send this data to someone else.
Another wrench in the works: this researcher doesn't have access to a server, so I can't do SFTP uploads that way. It's also not guaranteed that the app will have internet access all the time.
The best idea I've got so far is to have a button to compose an email that attaches an encrypted file, protected by a password whose hash is hard-coded, I mean, compile-time provisioned, into the app.
EDIT: Here's what I'm going to do for the time being: use some personal server space so I can implement SFTP uploading, and then I will work with the researcher to get some server space they can use. Thanks for your answers.
Email is not particularly "safe" but if you just want to send email to one specific address, without the possibility of user intervening, you can use SMTP protocol yourself.
In one of my old apps I used skpsmtpmessage - I don't know if it still works, but if not there should be more solutions like it.
What it does is basically send email messages programatically, without using the composer dialog.

Rails, sending mail to an address with accented characters

I am sending emails via Rails, ActionMailer, 1.9 Ruby and rails 3.0
All is good, I am sending emails with accented characters in subject lines and body, without issue. My charset default is UTF-8.
However when I try to send an email to an address containing accented characters it is failing miserably. I first had errors about the email address being invalid and it needing to be fully qualified.
To get around that, I needed to specify the email address in the format '"" '.
However it is sending now, but the characters in the address on the mail client, appear as =?UTF-8?Q?.... which is correct, Rails is rightly encoding my UTF8 address into the header for me.
BUT
My mail client is not recognising this in its display, so it renders all garbled on screen. garbled as in the actual text =?UTF-8?Q?.... appears in the "To" field on the client.
The encoding is UTF8 etc. charset is UTF8, Transfer Encoding is quotable printable.
What am I missing? It is doing my head in!
Also, as a test, I sent an email from my mac mail client to an address with accented characters. This renders fine in my client, however the headings are totally different... as in the charset is an iso, the transfer encoding is base64.... so I am thinking I need to somehow change actionmailer to encode my mails differently? i.e. using iso and base64 encoding to get it to play nice?
I tried this but to no avail. I am either doing it wrong or completely missing the point here? From readong the various forums and sites on this, I need to encode the header fields in a certain way, but I am failing to find the answers I need to tell me exactly what that encoding is and more specifically how can I do this in Rails?
Please help! :-)
finally solved this, if you wrap the local part of the email in quotes, and leave the domain part unquoted it works a treat. Seems like Mailer is encoding the full email address if you dont wrap in quotes, and hence breaks the encoding over to the server.
e.g.
somébody#here.com wont work
where as
"somébody"#here.com will work
routes through fine and displays fine in all clients.
Currently not all mail servers support UTF-8 email addresses (aka SMTPUTF8 ) a lot of them will do crazy things (even content malformation of headers). Can you check to ensure that your encoding header made it all the way through the mail server and wasn't ripped out?
The MTA would have to support RFC6530 to support UTF-8 addresses so it may not be your applications fault.

check email existence using Delphi with Indy or any other components/tools for Delphi

I need to check email accounts whether exists or not, I need to do that using Delphi and Indy (if possible)
I have a windows database for ERP system and I need to make sure that the customer enter valid email into the system so I can send to my customer the quotes they request.
I tried to test on yahoo and google using send commands HELO, MAIL and RCPT but no success.
Mail servers have to protect themselves against spammers and others with malicious intent. They are not going to give up their secrets easily. It is common for mail servers to be configured to black hole messages sent to non-existent recipients. They don't respond to the sender saying, "sorry, that user doesn't exist, please try again."
So, if you want to verify whether or not an e-mail address has a human behind it I think the only way to be sure is to send an e-mail requesting a response.
You have to ask your customers to confirm their email address, i.e. entering it twice to reduce misspellings, asking to register and sending an activation link and so on. State explicitly they need a valid email address: if they're asking you a quote why should they enter an invalid address? But be aware some people may use disposable email addresses to protect their real ones.
You have no way to check if an address really exists just asking its server. Due to the large amount of spam and techniques implemented by spammer to harvest and clean their addresses lists, most servers are setup to defend themselves.
That's why I suggested to "be polite". I am sorry if you got it the wrong way, I was just telling you that if your application shows a "spammer-like" behaviour (and your previous version of the question was much unclearer about your aims), it can lead to your IPs being blacklisted. Then you can have much more troubles to send quotes to customers.
You may try ICS components, an open source library with good examples (see SMTPClient).
So this library or another one will not tell you if an email account exists or not because it's depending on the way the host answer to the commands about a non existent account.
In ICS, when the command have been sent you may have to manage an event : SmtpRequestDone(Sender: TObject; RqType: TSmtpRequest;ErrorCode: Word);
Where ErrorCode is the Error code (ie 550).

Resources