Cant we use javaascript and jquery while preparing page that goes as email - html-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.

Related

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.

Sending jquery-mobile form data to an email address

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:.

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 notifications sent by Drupal have broken links sometimes

I'm using the Subscriptions module of Drupal to send out subscribed emails on a regular basis and I've noticed that the links embedded in the email will break if the link is too long, but only for some users. The email client that user is using is Entourage. The crazy thing is that I use Entourage, also, but I don't have that problem with the links in my subscription emails that are sent to me. Here's what's happening:
http:samplelinkhere?var=blahblah
blahblah
The top line of the link will be underlined and part of the link, but the bottom part will not be underlined (even though it should be) and so, the link is broken. Does anyone know how to fix this issue?
AFAIK, there is not much you can do about this. As long as the links do not contain line breaks in the original mails sent by your server, it is up to the receivers mail client to add line breaks for readability, usually based on some user preference settings (Which could explain the difference to your own Entourage client).
Also, some clients try to detect links and avoid breaking them, others don't, and some even have plugins for this.
A possible workaround would be sending HTML mails instead, but that opens a huge different can of worms concerning mail client compatibility, so I do not recommend it.