Last post May 15, 2012 06:02 PM by nijhawan.saurabh
May 14, 2012 05:19 PM|karthik_newbie|LINK
In my webpage i need to use mailto: to mail to several recipiencts( can be in 100's).
When it was having too many recipients the mail was not even opening. I read somewhwere that there would be some limitation for the number of charachters in the url of mailto.
Is that correct? If that is the problem then can anyone please tell me how to handle this situation?
May 14, 2012 05:27 PM|nijhawan.saurabh|LINK
Extremely long URLs are usually a mistake. URLs over 2,000 characters will not work in the most popular web browser. Don't use them if you intend your site to work for the majority of Internet users.
It is even probable that the limitations vary from browser to browser, or from E-Mail client to E-Mail client.
Way out to solve this:
Rather use a HTML form and a server-side script to send the emails.
May 14, 2012 05:31 PM|karthik_newbie|LINK
Ok. But my application works that way, it has several recipeints. So may be i will try with the server side script.
If possible please give me a code snippet on how to do that.
May 14, 2012 05:51 PM|nijhawan.saurabh|LINK
Use System.Net.Mail class:
Here's an example which uses Gmail smtp server to send email, in your case use your smtp settings.
May 14, 2012 06:06 PM|karthik_newbie|LINK
Ok, i have one more question.
How does this differ froom using simple mailto: ??
Even using this, i need to add all the recepients to the mail message right?
May 14, 2012 07:49 PM|karthik_newbie|LINK
I am just rephrasing my question once again. Because may be i am not clear above.
I need to open my default mail client with recipients list (which will be in 100's).
For this i am using <a href=mailto:<%= txtmail.Text %>>Send an email</a>.
But if the txtmail.Text is too large the mailto is not working. So i need to handle this scenario please do suggest me some solution.
May 15, 2012 04:36 AM|nijhawan.saurabh|LINK
It differs because using mailto, the whole body goes into the url, which has length limitations.
If you use System.Net.Mail class, there's no such limitation on length.
May 15, 2012 04:08 PM|karthik_newbie|LINK
So using System.Net.Mail can i open default mail client??
I am little bit confused.
May 15, 2012 04:13 PM|nijhawan.saurabh|LINK
Well it'd use the smtp settings to configure it for.It'd use those settings and send out mails for you.
May 15, 2012 04:17 PM|karthik_newbie|LINK
Ok i just need to open the mail clent. Then user should be able to modify the recipient address or add any new.
So i need to just open the mail cleint thats it.
So can i do that?
May 15, 2012 06:02 PM|nijhawan.saurabh|LINK
If you want the user to send mails using his local mail client then you'd use mailto only, which would open his default mail client.
And then as you said he can edit recipent list.
The other solution including System.Net.Mail one was supposed to be sending mail using server's smtp settings.