Solved

Is there anyway to increase the size limit on a "mailto" function

Posted on 2013-02-04
1
500 Views
Last Modified: 2013-02-05
Hi,

I have a list of contacts with emails, I want the user to be able to select the contacts they want to email and click a button to open up Outlook and populate bcc.

This is ok unless they select a lot of email addresses and the URL is too long, is there a way to get around this?

function SendEmails()
			{
				var blVals = false;
				var emailto = '';
								
				for (n = 0; n < document.frmSendMail.elements.length; n++)
					{
						if (document.frmSendMail.elements[n].name.substring(0,5) == 'Mail_')
							{
								if (document.frmSendMail.elements[n].checked)
									{
										var fieldname = 'EmailTo' + document.frmSendMail.elements[n].name.substring(document.frmSendMail.elements[n].name.indexOf('_'));
										
										var emailto = emailto + ';' + document.getElementById(fieldname).value;
										
																	
										blVals = true;										
										
									}
							}
					}
					
				if (blVals == false)
					{
						alert('Please select performers to email...');
						return false;
					}
				else
					{
						location.replace('mailto:&bcc=' + emailto);
					}
			}
			

Open in new window

0
Comment
Question by:Tra71
1 Comment
 
LVL 7

Accepted Solution

by:
Robby Swartenbroekx earned 500 total points
Comment Utility
Depending on the browser you are using.
IE for example supports URL's up to 2083 characters.
maybe do a check, if your emailto field goes over the 2000 characters, start a new mail message.
I tought outlook also had a maximum of 50 recipients for each message.

50 recipients is mostly not 2000 characters, I think it's even better to make a message every 50 users, or maximize the amount of selectable adresses to 50.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now