I am creating an email like this:
System.Diagnostics.Process.Start(
string.Format("mailto:{0}?&subject=Test&body={1}",
string.Join(", ", emails),
string.Join("\n", temp.ToArray())
)
);
However Gmail says that the link is too long. I’ve read this and it seems that it would solve my issue if I sent this via POST since 16K would be enough for me. Is it possible to do that and how?
UPDATE I mentioned Gmail’s case in the example, but I need any default email software to work with this. For example if it opened with Outlook, I would need it work too.
QUESTION UPDATE/CLARIFICATION How do I send the request (above) using POST instead of using GET (because GET’s limit is too short)?
I think you have two choices.
One is to create your message body as an attachment, by adding
&attachment=<filename.html>to yourmailtoURL. Some email clients support this, perhaps the Google code that translatesmailtolinks into GMail requests does, too.If the above doesn’t work, and you’re sure you only want to use GMail, you’ll need to switch to communication with the server directly. You can use the GMail SMTP server. Read here about their support for authentication: https://developers.google.com/google-apps/gmail/oauth_overview.