Url Length limitation for "mailto:xxxx?&cc=xxxx&subject=xxxx&body=xxxx"

Hi All..

I want to generate automatic Emails after setting up the mailto, cc, subject, body components dynamically.. Lotus Notes is my default email client.

 My code goes like this..

message = string.Format(@"mailto:{0}?&cc={1}&subject={2}&body={3}", recipients, cc, subject, messageText);

//Open registered email client with the formatted message.
System.Diagnostics.Process.Start(message);

The email generation fails in case of subject or message goes longer.. I cannot assure of a fixed length of this URL.. It varies in cases..

Please help me out to solve this issue If anyone knows how to resolve it out...

Thanks in advance...

0
sundari
4/22/2009 11:07:57 AM
asp.net.web-forms 93655 articles. 3 followers. Follow

3 Replies
413 Views

Similar Articles

[PageSpeed] 9

You have a lot of limits to consider:

The amount of characters allowed in a url


The maximum length of email subjects

The maximum length of a command line in windows



What sort of length are you talking about?

You can send emails using asp.net instead of the method you use above:


In fact thinking about it I think that if you tried your code above on a production server it would fire the mailto: link on the server side not your client.


Also a minor note - you dont need the & on the first parameter so it would be ?cc= rather than ?&cc=
0
rtpHarry
4/22/2009 12:07:17 PM

Thanks for the response..

I got to know by surfing the maximum length limitations in IE., But I need to automate email generation in Lotus Notes with such long messages.. Any other possible way to do it??  I am not sure whether this might work on my Production Server.. I need to test it in client side itself..

I heard that SMTP protocols can be used as an alternative solution for this.. Would that be possible or will it affects the security?

0
sundari
4/22/2009 2:15:01 PM

sundari:
I got to know by surfing the maximum length limitations in IE., But I need to automate email generation in Lotus Notes with such long messages.. Any other possible way to do it??  I am not sure whether this might work on my Production Server.. I need to test it in client side itself..
 

Yes like I said above if you use the mailto: link the way you do above I think it will try to open the new email on the server which is not what you want.

 

sundari:
I heard that SMTP protocols can be used as an alternative solution for this.. Would that be possible or will it affects the security?
 

SMTP is the protocol for outgoing email.

POP3 is the incoming email protocol.

If you used Lotus Notes then pressed send it would go out with SMTP.

 

What you should do is read the first few FAQs on this site which explain how to use asp.net to send the email for you:


If you dont have a mail server handy then you can use gmail. Mudassar has a great tutorial which explains how to do that:

0
rtpHarry
4/22/2009 9:40:52 PM
Reply:

Similar Artilces:

\uXXXX && &#xxxx
Hi All i am running a java web app and have java resource bundles that contain Japanese /Chinese native characters. -i need to covert the strings to 2 Unicode formats , on like this \ua9e0 for each character on like this &#a9e0 for each character What modules / methods can i use to do this ? Any ideas? i can read in the whole string per line and convert the characters if there is such a fuction/module -- Steve Dublin ...

form ID "__aspnetForm"
I have a server form embeded in an ascx control. In the ascx, the form is defined like this:<form runat="server" id="IDName">On my development machine, the page rendered to the browser has the ID in the format of "ControlName:IDName":<form name="ControlName:IDName" method="post" action="Default.aspx" id="ControlName_IDName">However, on our live site, the form has the name "__aspnetForm":<form name="__aspnetForm" method="post" action="Default.aspx" id="__aspnetFor...

RFE: for "%%" becoming to "&&" as "//" is to "||"; the "defined(x) && expr" operator...
In looking at the 5.10 perl5op doc's, I was thinking about the "//" operator and how in an expression "a // b" it tests 'definedness' the left-hand-side and returns it if it is defined, otherwise, it returns the right hand side. The idea being that you might normally use "||" but if the 'lhs' could be integer '0', it wouldn't work as desired. I think it could be useful to provide an equivalent operator for '&&', say '%%', that tests 'defined(lhs)' and if true, returns the 2nd part (rig...

Questions of practicality for the &amp;amp;quot;smaller developers&amp;amp;quot;
Is this going to be your typical $700-$1000 or so upgrade, which will in turn lead to yet another $700-$1000 or so upgrade for the 2005 version just down the road? I'm not nitpicking, I'm just as excited as can be... but I have to brace myself for the reality that it may be self defeating to plunk down that much cash and make the tansitions that go along with it when Whidbey is in fact a brief stopover to yet another big release. Of course, I'd love to hear that I'm way off base. some answers: 1: why do you care? Put it into your pricing calculations. The time savings for he end...

"&" become "&amp;" in QueryString when databinding.
I am trying to bind some data to form a QueryString in a custom button column in a custom datagrid. as shown below:         private void cell_DataBinding(object sender, EventArgs e)         {                  string URLconnector = (strUrl.IndexOf("?")>0)?@"&":@"?";                 ((Button)(cell.Controls[0])).Attributes.Add("onclick", @"window.showModalDialog('container.aspx?url=" + strUrl + &...

Testing for existence of &lt;form runat=&quot;server&quot;&gt;
I have developed a Button control, inheriting from System.Web.UI.Control. For the button to work, it must be within a <form> ... </form> block. I cannot find any information online or in the SDK documentation as to how the ASP.NET server controls make this test, and whether they use a method or property that I can also use. Surely I don't have to walk up the Control tree for each such control to see whether it is ultimately contained within an HTML form element? Thanks to anyone who can offer assistance.Alister Use the Page.VerifyRenderingInServerForm method. Peter L...

How to add &quot;&lt;form runat=server&gt;&quot; programmatically ?
Hi. I'm creating a custom webcontrol. The control should be able to recive usercontrols and place them in a "html-template". In your page you should be able to send in a usercontrol (ascx-file) and my webcontol will place it in a predefined htmltable. Feks. (in codebehind.vb) Dim myUserControl as Control = LoadControl("/myUserControl.ascx") Dim a as new ns.TemplateControl() a.title = "This is the title of the page" a.keywords = "Keywords, key, words" a.AddControlToRightMenu(myUserControl) 'Send control to the template...

Input Form to Display Message&quot;text&quot; On Submit&quot; click
Edited by SomeNewKid. Please post code between <code> and </code> tags. I have designed a form that correctly sends the input from my fields to my e-mail. I'm stumped as to how to get the script to display a message like "your message has been sent" after clicking the Submit button. I've tried everything. How should one handle multiple events with "on Submit. Thanks Here's a bit of the code: <%@ Page %> <script runat="server"> Sub Button1_Click(sender As Object, e As EventArgs) ' Build a MailMessage Dim ma...

.Replace("&amp;", "&") doesnt seem to work.
 protected void Button3_Click(object sender, EventArgs e)    {        ExportGridToExcel(GridView2, "cc");       }    public void ExportGridToExcel(GridView grdGridView, string fileName)    {        Response.Clear();        Response.AddHeader("content-disposition",        string.Format("attachment;filename={0}.csv", fileName));    &...

Textbox visible=&amp;quot;false&amp;quot;
I have a table with 4 columns, so I made a script who ad data to this column. But I have 3 textboxes in that form, one columns named "Display" must always have the value Yes. But If I say <asp:textbox id="DispalyText" runat="server" rows="0" columns="40" visible="false" /> The script ad nothing to the database. If I set the visible="True" then Yes is Ad to the database !! What can I do? Or is it possible, that a datalist don`t show the record with the value Display="No" . The data...

how do i do &lt;a href="#name"&gt; &lt;a name="name"&gt; on immagebutton
if the page is too long, when the page is posted back, i want it to move to original location where the user click it. can i do it with imagebutton without using Response.Redirect ?...

&quot;&lt;div&gt;-iculties&quot;
I have the following html, which if placed in an html page renders exactly what I want - a header, a left "menu bar" and a scrolling main body area. However, when I place the same code in an aspx page, it basically ignores(?) the height settings, and "scrunches" everything up at the top. <div style="WIDTH:100%; HEIGHT:15%; BACKGROUND-COLOR:blue" align="center"> <br> This is the header</div> <div style="height: 85%"> <div s...

Gridview1 changed "&" being to &amp;
Code: Dim TempSupplierSelected As String = GridView1.SelectedRow.Cells(1).Text Information shown in the gridview is "Tom & Jerry" TempSupplierSelected variable give me a "Tom &amp; Jerry" How can I change the &amp; into a regular & so I can put that in my SQL string to get information from my database? Thanks!! you can decode that data with HttpUtility.HtmlDecode http://msdn2.microsoft.com/en-us/library/7c5fyk1k.aspxDim TempSupplierSelected As String TempSupplierSelected = HttpUtility.HtmlDecode(GridView1.SelectedRow.Cells(1).Text)  Mike Ban...

Help figuring out how to include "&" in my code without it appearing like this "&amp;"
Hi,  I have code behind that is supposed to dynamically create the Href for my LinkButton on the front end... Problem is when the link is expressed as 1)  http://www.picnik.com/service?_apikey=2f73b54481c4230d6eb7143190a8b5cd&amp;_import=http://www.BeetleDome.com/Project/156/ProjectImages/76924_m.jpg &amp;_export=http://www.Beetledome.com/User/MyPhoto.aspx&amp;_export_agent=browser &amp;_export_method=GET&amp;_export_title=Beetledome &amp;_host_name=Beetledome&amp;_original_thumb=http://www.Beetledome.com/Project/156/ProjectImages/76924_m.jpg &a...

Web resources about - Url Length limitation for "mailto:xxxx?&cc=xxxx&subject=xxxx&body=xxxx" - asp.net.web-forms

Resources last updated: 12/25/2015 7:27:06 PM