C# MailTo with Attachment?

If you want to access the default email client then you can use MAPI32.dll (works on Windows OS only). Take a look at the following wrapper: http://www.codeproject.com/KB/IP/SendFileToNET.aspx Code looks like this: MAPI mapi = new MAPI(); mapi.AddAttachment(“c:\\temp\\file1.txt”); mapi.AddAttachment(“c:\\temp\\file2.txt”); mapi.AddRecipientTo(“[email protected]”); mapi.AddRecipientTo(“[email protected]”); mapi.SendMailPopup(“testing”, “body text”); // Or if you want try and do a direct send without … Read more

Mailto with multiple cc addresses

You need a semi-colon as the separator. <a href=”https://stackoverflow.com/questions/26509787/mailto:[email protected]?subject=[Help]%20Base Leisure&[email protected];[email protected]”>Contact Email</a> Some e-mail clients (e.g. Android’s GMail) won’t allow mailto: links to duplicate the same e-mail address in both To: and Cc: fields.

How to prevent mailto event from opening a new tab in browser

Thank you for the edit. There is indeed an alternative: window.location.href = “https://stackoverflow.com/questions/13457684/mailto:[email protected]”; alert(“Thank you!”); I don’t want to use window.location.href since I am displaying a message after the user sent the email. I did not really get this one. You are not leaving the website when using mailto: with window.location.href

How to open mailto links in new tab for users that have gmail as the default mail handler?

Okay, so I was able to get this working in Chrome on Mac. Your mileage may vary. Also, this is pretty hacky IMO, so it may not be worth it. Honestly this should exist as a setting within Chrome, and the behavior should be delegated to the website. E.g. Chrome should have an option: “[x] … Read more

Mailto on submit button

In HTML you can specify a mailto: address in the <form> element’s [action] attribute. <form action=”mailto:youraddr@domain.tld” method=”GET”> <input name=”subject” type=”text” /> <textarea name=”body”></textarea> <input type=”submit” value=”Send” /> </form> What this will do is allow the user’s email client to create an email prepopulated with the fields in the <form>. What this will not do is … Read more

Webview email link (mailto)

You have to create a subclass of WebViewClient and override mailto URL loading. Example: public class MyWebViewClient extends WebViewClient { private final WeakReference<Activity> mActivityRef; public MyWebViewClient(Activity activity) { mActivityRef = new WeakReference<Activity>(activity); } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.startsWith(“mailto:”)) { final Activity activity = mActivityRef.get(); if (activity != null) { MailTo … Read more

Use as a button and trigger a mailto when it is clicked

Try this, and tell me if works. (If not, I will delete answer.) <script> function sendEmail() { window.location = “mailto:xyz@yourapplicationdomain.com”; } </script> <div onclick=”sendEmail();”>Send e-mail</div> It is possible to pass the parameters subject and body, but I think that it is not possible to format the text: <a href=”https://stackoverflow.com/questions/19639900/mailto:xyz@yourapplicationdomain.com?subject=Me&body=Hello!”>EMAIL</a>

tech