Home > Internet / LAN > How to Send E-mail With the Default E-mail Client

How to Send E-mail With the Default E-mail Client

October 19th, 2007 Leave a comment Go to comments

You may want to allow users to send you back feedback. You can either send it directly to your site via sockets or send the user to your website. What if you don’t have a website? No feedback? Yeah, right. Just have them send it to you by e-mail.

You can not send spaces in URLs, you have to convert them first. Example: if the subject were to be ‘Bug Report!’ then you should put %20 instead of the space character – ‘Bug%20Report!’. %20 is the ASCII value for space.

In this example MemoBugText is the memo in which the user describes the bug, ‘bugreports@youremail.com’ is your e-mail address and ‘Bug Report’ is the subject of that e-mail.

uses
  ShellAPI, Windows;

// For more information on ShellExecute() check out our tip
// "How to run programs and execute documents, mailto links and URLs" in the Windows category
ShellExecute(0, 'open', PChar('mailto:bugreports@youremail.com?subject=Bug%20Report&Body=' + MemoBugText.Text), nil, nil, SW_SHOWNORMAL);
  1. No comments yet.