How to add javascript codes in the HTML email body

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
susovanchanda
Forum Newbie
Posts: 7
Joined: Tue May 30, 2006 8:52 am

How to add javascript codes in the HTML email body

Post by susovanchanda »

Hello,

Can anyone tell me whether its possible to add some javascript codes in the HTML email body?

Regards

Susovan Chanda


[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

yes, it's possible
susovanchanda
Forum Newbie
Posts: 7
Joined: Tue May 30, 2006 8:52 am

Post by susovanchanda »

How?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

insert them between <script> and </script> tags
susovanchanda
Forum Newbie
Posts: 7
Joined: Tue May 30, 2006 8:52 am

Post by susovanchanda »

Thanks for your response.
Are you sure about this? Because I have already tried with this and sent some test mails(HTML type) to yahoo and gmail account. But it does not work.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

susovanchanda wrote:Thanks for your response.
Are you sure about this? Because I have already tried with this and sent some test mails(HTML type) to yahoo and gmail account. But it does not work.
Yahoo and gmail both strip javascript from emails. Most major web based email systems do. Javascript in an email is almost definitely a bad thing.
susovanchanda
Forum Newbie
Posts: 7
Joined: Tue May 30, 2006 8:52 am

Post by susovanchanda »

You are right. I have observed the same in view source.
Actually I was using javascript in the email body so that when the mail is forwarded or opened it(javascript) will report to the server. In this way I can keep track my email i.e. I can knwo the email addresses where my email has been forwarded to.

Seems it javascript will not help me to do this. Do you have any idea?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Actually I was using javascript in the email body so that when the mail is forwarded or opened it(javascript) will report to the server.
That's one of these bad things Roja has mentioned.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

susovanchanda wrote:Actually I was using javascript in the email body so that when the mail is forwarded or opened it(javascript) will report to the server. In this way I can keep track my email i.e. I can knwo the email addresses where my email has been forwarded to.

Seems it javascript will not help me to do this. Do you have any idea?
My idea would be not to do that, or to encourage readers to click to your site because you have something worthwhile on your site to click on.

But ignoring the importance of actually building content worth going to, just to trick users to give you what you want (all while giving them nothing in return), the current common practice in email is to include an image served from your server. That image is accessed by the user, which your server logs - their IP, possibly their browser string, the time, etc.

Notably, many mail programs (gmail included) also turn off images.

You are trying to do something that most sane people recognize as giving no value to a user, and giving great value to you - without telling the user. Since the programs are there to help the users - not you - most programs make it hard to do that.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

~susovanchanda I've just read over every post you've made on this board. I hope I'm wrong but it sure sounds like you're intent on harvesting email addresses and beyond that you want to check which ones are actually in use. Invasion of privacy? Yes.

I'm *asking* you not to post any further queries on this matter here. Post elsewhere on this issue - it's harsh situation if you have legitimate reasons I know. But how could you explain any legitimate reason for needing this? You should be asking your users for the info... not taking it transparently.

Regards,

d11
Post Reply