iphone php script - iphone

I'm trying to send information from obj-c to my php script, but as I've learned, I can't send text that has _'s in it. I'm using the $_GET[''] function in PHP and it won't accept when I send it spaces.
For example, when I send the data to the url in objective-c I get this:
http://test.com/test/test.php?url=http://test.com/test/images/2011-07-22/542.jpg&username=iMac&comment=test comment with space
Any recommendations?
Cheers,
Filip,

URL Encode it. That's what it's for.

Related

Swift 4, CorePlot, send chart via mail app (with MessageUI)

Can I somehow take the chart (which was made with CorePlot) from view and send it as a file to another person via mail app? I want to send mail with the help of MessageUI. I feel fine if just the picture will be sent.
Use the -imageOfLayer method to get a PNG of the graph or the -dataForPDFRepresentationOfLayer method to get a PDF and attach the resulting file to a message.

Urls with special characters are not converted correctly by SendGrid

I have a url in one of my emails for twitter share that looks like:
http://twitter.com/share?text=Praneeta%27s%20test&url=http%3A%2F%2Fwww.mydomain.com%3Fparam1%3D303%26param2%3Dtest&related=praneeta&via=Praneeta
However SendGrid converts only the part before the ' (encoded as %27)
So the url I have in the emails sent is broken and looks like
http://email.mydomain.com/wf/click?upn=<long_encoded_key>%27s%27s%20test&url=http%3A%2F%2Fwww.mydomain.com%3Fparam1%3D303%26param2%3Dtest&related=praneeta&via=Praneeta
Is there a work around for this?
note: If I copy the email html and send it to myself via putsmail, it works fine, it breaks only when it goes via Sendgrid.
I just sent the link you posted through my own SendGrid account and it looks like it was properly encoded. I wonder if this was a temporary issue? What happens if you try sending that link again?
Just a heads up on this issue incase if people stumble on this. The method should be escape for example:
CGI::escape('\'')

ASCII eqivalent of the symbol ampersand (&) in Obj C

I am sending emails from my iPhone app by calling a web service and in the email body I need to send a URL that contains an ampersand symbol (&). If I use the symbol in my URL the web service does not send the email, but if I remove that ampersand symbol everything works and the webservice sends the email just fine. So my question is, should I use the ASCII eqivalent of that symbol ? And if so, what is the ASCII eqivalent for '&'? Can any one help me?
This is my URL which has the ampersand symbol
http://xx.xxx.1.xx/xxx/aspxapprvcontrct.aspx?PartyEMail=xx#xxxx.com&devid= 1xx23
Thanks in advance.
You need to escape the whole string (email body) you are sending to your webservice. This question has been asked before on SO, see the link included below. I got it from the link #Caleb included, which in and of itself does not solve your particular problem. I would recommend looking at the second answer posted by #Michael Waterfall.
Objective C HTML escape/unescape

How to set up an email server that will accept a URL in the subject of an email and respond with a copy of that webpage

I'm trying to piece out how difficult it would be to set up an email server that will accept a URL as the subject of an email and respond with an attached copy of said webpage, or element(s) of that webpage (ie, an image from the page, or all of the videos on the page).
I don't necessarily need the code written for me, but would appreciate if someone could suggest a starting point.
I have very little web-programming knowledge (some C++, some Actionscript), which is partly why I don't even know where to begin.
There is several ways to achieve this.
In most unix MTAs you can set up an alias to pipe all messages for some address through a program.
This program need to parse the message header for the "from" and "subject", fetch the url and sent it back.
You can also do this with a program like fetchmail, so you dont even need to make something in the server side.
Finally, several languages have wonderful libraries fetch the mail using POP3, parse it, fetch the URL from the subject and compose a new mail message. Should be no more than 100 code lines with perl or python.

mailto with empty recipient?

is there anyway that I can use "mailto" with empty recipient? I only want to supply the subject and the message body and then the user can write the to addresses on mail. I tried writing only a space but it didn't work.
This should do, I tested it.
mailto:?subject=your%20subject&body=your%20body
And as HTML with correct escaping of the ampersand:
test
This should work..
test
I tried the accepted answer but it failed to launch an email when using Chrome. Using a %20 instead of a space worked though:
Send an Email