I would like to send a simple email message from my Delphi program. More specifically, if my program encounters an exception I want to provide the option to send the error via any specified email address the user provides, of course been able to send an Email for any situation itself would be beneficial. Having the ability to send attachments is a bonus, but not required.

I have tried many examples found online but most don't seem to work. Some of them require parameters such as SMTP server etc, but how can my program determine this if my user can freely enter there own email address? Additionally I don't have a default email client installed on my PC, so if I am unable to send an email from my program then i am sure anyone else who uses my program will have the same problem.

So basically what I am asking is:

  • How to send an email
  • Attachments is not required, but would have its advantages
  • How to handle things such as SMTP server, port numbers etc?
  • If no default email client is installed, how to handle this

I hope my post is easy to understand.

Thanks

Edit
Report