Sending jquery-mobile form data to an email address - forms

I am new to programming. I have built a multi-page form for an Android phone using jquery-mobile + phonegap. The form looks and works great, but it seems I have now hit a dead end.
I want the submit button to send the (preferably formatted data) to a specific email address, but am not sure how to do this. The Jquery-mobile documentation explains how to get or post to a url, but I really only want to send it to one or two recipients.
If I put a mailto:name#dom.com statement where the url is asked for it brings up the info in one long string in the native email client.
I'd give code examples, but at this point it is only the procedure I don't understand and am not sure it can be easily done.
Any helpful suggestions would be appreciated as I have exhausted my research sources without success.

Well you need to submit your form to the server-side script first and send your email from there.
In PHP on the server side you can use mail() to achieve that. The better alternative - PHPMailer.
On the client you can only use mailto:.

Related

Cant we use javaascript and jquery while preparing page that goes as email

I am developing a page, which will be sent to people as email. Just like advertisement emails which we usually get. I wanted to know that it will support only html-php or can we use javascript and jquery also in that. Thank You for help!
Generally no you cant use javascript in an email body, but it will depend on the email client used to view the email as to whether it's allowed or not. It'd bad practise generally, and if you do this the majority of your mails will not get to their destination. Also bear in mind the HTML and CSS supported by email clients is limited, so don't expect a page that works in your web browser to look the same on an email client.
You can of course use javascript to help render the body of the message, and then extract the HTML/CSS that's been generated, but don't include any of the javascript code itself in the body that gets sent.
This looks like a duplicate of Is JavaScript supported in an email message?...
As Russell says, email clients generally do not support scripting. Maybe one or two do, but the coverage will be very low.
what i want is the countdown timer which will be displaying in the
user email.
But... if what you're interested in is a countdown, you can do that in most email clients. If you have a webserver with PHP, here is a tutorial on how to do this. This won't work in Outlook 2007/10/13, but the coverage is pretty good considering it's interactive inside an email.
There are also online tools to accomplish a countdown timer, though I can't personally vouch for those.

Email questionnaire with checkboxes/radio buttons?

I know I could simply make a html form on a website and email a link to it, or send the html as an email which posts to the website and try to deal with the errors/warnings for different peoples mail clients.
But, due to a specific request from a client, I am wondering if there is a way I could send an email, a questionnaire, with the same checkbox elements which then user receiving the questionnaire simply checks and sends back as a reply to the sender?
This is not very well supported across email clients, and will even throw some scary looking error messages to your recipients. You will be much better served linking to a landing page.
More info: http://www.campaignmonitor.com/resources/will-it-work/forms/
Email only supports html and css. I think Google has something like that, but it is not widely supported.
Generally, neither html of css can submit a form or (if the form even displays) acknowledge which form fields are populated/checked. Pretty much all you have is hyperlinks.
Passing parameters in your hyperlink would allow you to pre populate a form, but that is about as tricky as you can get.
Something like this:
Register Now
You could then use PHP for example to populate the landing page form with the values. I know it doesn't help much for a questionnaire, but that's all we have to work with in email.

Hyperlinks are being overwritten in emails

I am sending out emails from my website using Zend_Mail and Send Grid. I have hyperlinks in the email that are being overwritten with what appears to be garbage by the time it gets to the user's inbox.
For example,
href="http://www.foo.com" is becoming href="http://email.foo.com/wf/click?upn=DSDRHSSBH2938TS".
I do not have this problem when I remove the 'http://' from the href. This is not a solution for me however, because links without 'http://' do not work in some email clients.
I checked the Zend Mail content and the links appear to be fine, so I am wondering if this is a problem with Send Grid or the email client. I have looked all over the web and have found very little information on this. I have seen some people with similar issues, but no one has been able to provide a real solution.
Has anyone seen anything like this? I'll be happy to provide more information if needed.
It looks like Send Grid is re-writing the URLs for click tracking. Try disabling this feature in your Send Grid account. https://sendgrid.com/docs/Apps/click_tracking.html

Email form results with jquery?

Can anyone show me a script or example of a form results being emailed with submit? Does jquery have any advantage with this?
Erik
jQuery might be the magical unicorn of scripting frameworks but even that isn't able to actually send an email.
Typically you would serialise your form values and pass these back to some server-side method to process; be that a PHP script, .Net method or whatever.
If you HAVE to have an email pop up when the user clicks a link or button, you might get some of the way by employing a (rather unattractive) approach like this.
But the bottom line really is, "Please don't".
Typically a website that sends an email as a result of submission will do this emailing on the server side (where a suitably configured SMTP client exists). You can use jQuery to validate the form on the client side (although you will still need to do server side validation) and to submit the form, which will POST it to program / script on the server side that will email whatever text it should email.
It might have some advantages like client side validation and "nice effects" or no refresh after send.
You must no that jquery isnt the one "sending the email" you might want to do this with php or any other methods just google email form or similar. :)
Here is a good example:
http://trevordavis.net/blog/ajax-forms-with-jquery/
Good luck!
the only advantage jQuery has with submitting the results is that you don't have to post to the page that actually does the submissions. What's nice about that is that the page doesn't refresh, and the user doesn't leave what he's currently doing. You can do a jQuery.ajax() POST to the email script, on the server, to process the email submission, and the user will still be on the page.

Email from an app, but not use a a pop up controller, just text inside a text box

is there any way to send whats in a text view (im trying to make a suggestion box) to my email address?
example
user types in the box " I think you should add twitter support"
then that is sent in the background to my email address example#gmail.com
then a message is popped up on the screen saying "suggestion sent"
just an example of what i mean
Any ideas, tutorial links would be greatly appreciated guys
Thanks
You can do this in php, asp or many another server side programming language. Depends what your server supports?
Your form action would be a php file that would then process the info sent in the form.
http://php.net/manual/en/function.mail.php
You can always roll out your own SMTP client code if you don’t want to use the built-in mail composer. But such a solution is not perfect – you have to have an SMTP server (or use an open relay, yuck) and the device has to be online or you have to write some network queue. As for the SMTP client library, quick search returns skpsmtpmessage (no idea if it works at all).
P.S. Do you insist on sending the suggestion by e-mail? Sounds like a simple HTTP POST into a database would do just fine.