Problem creating email in application using "mailto"

timh

Well-known member
Joined
Nov 28, 2008
Messages
50
Programming Experience
Beginner
One of the functions in my application is to send out a block email via the user's default email client, using "mailto".

However, I am running into a problem:

I loop through the rows of my dataset to extract the email addresses and add them to a string, then use the following code to generate the email:

VB.NET:
System.Diagnostics.Process.Start("mailto:" & "?bcc=" & bccStr & "&subject=" & (mainForm.eventname) & " " & (Year(mainForm.eventdate)))

All well and good except that it truncates the string when it is entered into the bcc field. Truncation is at 2157 characters.

I know that bccStr itself includes all the email addresses, as I have tested it by writing the string to the clipboard. Strangely, I can paste the string from the clipboard into the bcc field of Outlook without any truncation, so it's not a limit set by Outlook. I'm guessing it must therefore be a limitation of the "mailto" command?

Any ideas please?

At the moment, my work around has been to automatically create a number of separate emails, each with say 50 addressees. It works, but it's not very elegant.

Thanks.

Tim
 
...I should have carried on Googling a bit more. I now realise that the problem is due to the limit on characters in a URL and that there is apparently no way of working around this.

Unless anyone has a bright idea, I guess my solution will be to write the string to the clipboard and prompt the user to paste this into the "bcc" field when the new email opens up. Either that or work out how to send the email directly from within the program.
 
My first post on this forum back in 2004 was to ask basically that same question. As far as I was able to determine, there's no way to make it work the way you want.
 
My first post on this forum back in 2004 was to ask basically that same question. As far as I was able to determine, there's no way to make it work the way you want.
Thanks. The clipboard solution seems to work ok and requires minimum effort from the user, so I'm going to go with that.
 
any code for this that may help
You don't really need code provided. Its two steps: copy text to clipboard and prompt user to paste. How to do the first can be found easily with a web search and you should already know how to do the second.
 
Back
Top