473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

javascript: initiating email and embedding image to the email in IE and Mozilla

I have a requirement
When i click on button, i have to initiate an email with the to address, subject, and body should contain an image and the text .

Problem : I cannot embed the image using 'mailto' (javascript) . Please provide solutions for embedding image to the outlook or any email generator like outlook(if not present).

Thanks in Advance.
Oct 22 '08 #1
7 7433
acoder
16,027 Expert Mod 8TB
I don't think this will be possible with JavaScript. I would recommend using server-side code to send email.
Oct 22 '08 #2
is there any possible solution through client side. Server side i dont want because when the user clicks on button in his browser, outlook should open. If i do server side , then it will open in server not client side.
Thanks.
Oct 22 '08 #3
acoder
16,027 Expert Mod 8TB
Giving control to the client to send mail is always unreliable. Not all users have email properly set up on their computer. See how webmail works. The user can enter the message, attach files, include images, etc. then when they click 'Send', the email is sent from the server-side.

If, however, you have a select user-base and you know that all users will have Outlook installed and set up, then you could depend on mailto. As for the image, you can't embed it as such using JavaScript, but you can provide the full URL to the image in the email body.
Oct 22 '08 #4
Expand|Select|Wrap|Line Numbers
  1. var outlookApp = new ActiveXObject("Outlook.Application");
  2.             var nameSpace = outlookApp.getNameSpace("MAPI");
  3.             mailFolder = nameSpace.getDefaultFolder(6);
  4.             mailItem = mailFolder.Items.add('IPM.Note.FormA');
  5.             mailItem.Subject=Subject;
  6.             mailItem.To = ToAddress;
  7.             mailItem.HTMLBody = "image  here"+"<br><p><font face=Arial size=2>"+"BodyHi"+"<br>"+Bodypara1+"</p><br><br>"+footerregards+"</font>";
  8.             mailItem.display (0); 
  9.  
this works in IE , Can I get equivalent code for Mozilla?
Please help in this regard. or any optimal solution for both the browsers?
Oct 22 '08 #5
iam_clint
1,208 Expert 1GB
There isn't an equivalent in Mozilla... activex is IE only
Oct 22 '08 #6
is there any possible solution other than Activex through client side?
Oct 23 '08 #7
acoder
16,027 Expert Mod 8TB
Add a HTML <img> tag within the body and point to a web URL.
Oct 23 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.